diff --git a/k8sdeps/kunstruct/factory_test.go b/k8sdeps/kunstruct/factory_test.go index 25a54ad24..d0279d34e 100644 --- a/k8sdeps/kunstruct/factory_test.go +++ b/k8sdeps/kunstruct/factory_test.go @@ -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, diff --git a/pkg/resource/factory_test.go b/pkg/resource/factory_test.go index 8604ad2f9..5658a394a 100644 --- a/pkg/resource/factory_test.go +++ b/pkg/resource/factory_test.go @@ -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)