Skip to content

Commit bbb0b08

Browse files
committed
test: add empty list test
1 parent 77daec8 commit bbb0b08

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

api/krusty/no_list_items_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,20 @@ spec:
211211
ports:
212212
- containerPort: 80
213213
`)
214+
}
215+
216+
// Empty list should result in no resources
217+
func TestEmptyList(t *testing.T) {
218+
th := kusttest_test.MakeHarness(t)
219+
th.WriteK(".", `
220+
resources:
221+
- emptyList.yaml
222+
`)
223+
th.WriteF("emptyList.yaml", `
224+
apiVersion: v1
225+
kind: PodList
226+
items: []
227+
`)
228+
m := th.Run(".", th.MakeDefaultOptions())
229+
th.AssertActualEqualsExpected(m, "")
214230
}

0 commit comments

Comments
 (0)