mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 00:52:55 +00:00
move test case
This commit is contained in:
@@ -138,6 +138,22 @@ kind: Namespace
|
||||
metadata:
|
||||
annotations:
|
||||
foo: bar
|
||||
`),
|
||||
expectedOut: nil,
|
||||
expectedErr: true,
|
||||
},
|
||||
{
|
||||
name: "nil value in list",
|
||||
input: []byte(`
|
||||
apiVersion: builtin
|
||||
kind: ConfigMapGenerator
|
||||
metadata:
|
||||
name: kube100-site
|
||||
labels:
|
||||
app: web
|
||||
testList:
|
||||
- testA
|
||||
-
|
||||
`),
|
||||
expectedOut: nil,
|
||||
expectedErr: true,
|
||||
|
||||
@@ -98,21 +98,6 @@ items:
|
||||
patch7 := `
|
||||
apiVersion: v1
|
||||
kind: List
|
||||
`
|
||||
patchList5 := types.PatchStrategicMerge("patch8.yaml")
|
||||
patch8 := `
|
||||
apiVersion: builtin
|
||||
kind: ConfigMapGenerator
|
||||
metadata:
|
||||
name: kube100-site
|
||||
labels:
|
||||
app: web
|
||||
testList:
|
||||
- testA
|
||||
-
|
||||
literals:
|
||||
- FRUIT=apple
|
||||
- VEGETABLE=carrot
|
||||
`
|
||||
testDeploymentSpec := map[string]interface{}{
|
||||
"template": map[string]interface{}{
|
||||
@@ -154,7 +139,6 @@ literals:
|
||||
l.AddFile("/"+string(patchList2), []byte(patch5))
|
||||
l.AddFile("/"+string(patchList3), []byte(patch6))
|
||||
l.AddFile("/"+string(patchList4), []byte(patch7))
|
||||
l.AddFile("/"+string(patchList5), []byte(patch8))
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -204,12 +188,6 @@ literals:
|
||||
expectedOut: []*Resource{},
|
||||
expectedErr: false,
|
||||
},
|
||||
{
|
||||
name: "listWithEmptyList",
|
||||
input: []types.PatchStrategicMerge{patchList5},
|
||||
expectedOut: []*Resource{},
|
||||
expectedErr: true,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
rs, err := factory.SliceFromPatches(l, test.input)
|
||||
|
||||
Reference in New Issue
Block a user