add a test for a list with no 'items:' provided

This commit is contained in:
Andrew Lavery
2019-02-12 15:07:46 -08:00
parent 3118ccfd05
commit d72b16235a

View File

@@ -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)