diff --git a/api/krusty/no_list_items_test.go b/api/krusty/no_list_items_test.go index b6cc58742..49092b0bd 100644 --- a/api/krusty/no_list_items_test.go +++ b/api/krusty/no_list_items_test.go @@ -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, "") } \ No newline at end of file