mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-09-15 12:18:57 +00:00
test: add empty list test
This commit is contained in:
@@ -211,4 +211,20 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
`)
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Empty list should result in no resources
|
||||||
|
func TestEmptyList(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", `
|
||||||
|
resources:
|
||||||
|
- emptyList.yaml
|
||||||
|
`)
|
||||||
|
th.WriteF("emptyList.yaml", `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PodList
|
||||||
|
items: []
|
||||||
|
`)
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
th.AssertActualEqualsExpected(m, "")
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user