diff --git a/pkg/resource/factory_test.go b/pkg/resource/factory_test.go index b8138676f..8d9af62a3 100644 --- a/pkg/resource/factory_test.go +++ b/pkg/resource/factory_test.go @@ -93,6 +93,11 @@ items: apiVersion: v1 kind: List items: +` + patchList4 := patch.StrategicMerge("patch7.yaml") + patch7 := ` +apiVersion: v1 +kind: List ` testDeploymentSpec := map[string]interface{}{ "template": map[string]interface{}{ @@ -133,6 +138,7 @@ items: l.AddFile("/"+string(patchList), []byte(patch4)) l.AddFile("/"+string(patchList2), []byte(patch5)) l.AddFile("/"+string(patchList3), []byte(patch6)) + l.AddFile("/"+string(patchList4), []byte(patch7)) tests := []struct { name string @@ -176,6 +182,12 @@ items: expectedOut: []*Resource{}, expectedErr: false, }, + { + name: "listWithNo'items:'", + input: []patch.StrategicMerge{patchList4}, + expectedOut: []*Resource{}, + expectedErr: false, + }, } for _, test := range tests { rs, err := factory.SliceFromPatches(l, test.input)