Skip to content

Commit c6a4801

Browse files
author
gopal
committed
Return empty list when there is no matching resource instsnce items to return
1 parent 36cfbe6 commit c6a4801

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kubernetes/base/dynamic/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def __init__(self, client, instance):
291291
kind = instance['kind']
292292
if kind.endswith('List') and 'items' in instance:
293293
kind = instance['kind'][:-4]
294-
for item in instance['items']:
294+
for item in instance.get('items', []):
295295
if 'apiVersion' not in item:
296296
item['apiVersion'] = instance['apiVersion']
297297
if 'kind' not in item:

0 commit comments

Comments
 (0)