Skip to content

Commit

Permalink
Return empty list when there is no matching resource instsnce items t…
Browse files Browse the repository at this point in the history
…o return
  • Loading branch information
dirrao authored and gopal committed Nov 28, 2023
1 parent 36cfbe6 commit 5194426
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kubernetes/base/dynamic/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ def __init__(self, client, instance):
kind = instance['kind']
if kind.endswith('List') and 'items' in instance:
kind = instance['kind'][:-4]
if not instance['items']:
instance['items'] = []
for item in instance['items']:
if 'apiVersion' not in item:
item['apiVersion'] = instance['apiVersion']
Expand Down

0 comments on commit 5194426

Please sign in to comment.