test: add empty list test

This commit is contained in:
isarns
2024-08-18 14:56:54 +03:00
parent 77daec89b8
commit bbb0b08576

View File

@@ -211,4 +211,20 @@ spec:
ports:
- 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, "")
}