mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 09:02:53 +00:00
add tests for *List kinds and empty lists
This commit is contained in:
@@ -42,6 +42,15 @@ func TestSliceFromBytes(t *testing.T) {
|
||||
testConfigMap.Map(),
|
||||
},
|
||||
})
|
||||
testConfigMapList := factory.FromMap(
|
||||
map[string]interface{}{
|
||||
"apiVersion": "v1",
|
||||
"kind": "ConfigMapList",
|
||||
"items": []interface{}{
|
||||
testConfigMap.Map(),
|
||||
testConfigMap.Map(),
|
||||
},
|
||||
})
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -151,6 +160,24 @@ items:
|
||||
expectedOut: []ifc.Kunstructured{testList},
|
||||
expectedErr: false,
|
||||
},
|
||||
{
|
||||
name: "ConfigMapList",
|
||||
input: []byte(`
|
||||
apiVersion: v1
|
||||
kind: ConfigMapList
|
||||
items:
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: winnie
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: winnie
|
||||
`),
|
||||
expectedOut: []ifc.Kunstructured{testConfigMapList},
|
||||
expectedErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
Reference in New Issue
Block a user