Skip to content

Commit 1992802

Browse files
authored
Merge pull request kubernetes-client#2155 from dirrao/2142-dynamic-client-empty-results-bug
Return empty list when there is no matching resource instsnce items …
2 parents 36cfbe6 + 5194426 commit 1992802

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kubernetes/base/dynamic/resource.py

+2
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ def __init__(self, client, instance):
291291
kind = instance['kind']
292292
if kind.endswith('List') and 'items' in instance:
293293
kind = instance['kind'][:-4]
294+
if not instance['items']:
295+
instance['items'] = []
294296
for item in instance['items']:
295297
if 'apiVersion' not in item:
296298
item['apiVersion'] = instance['apiVersion']

0 commit comments

Comments
 (0)