Skip to content

Commit

Permalink
Merge pull request #2155 from dirrao/2142-dynamic-client-empty-result…
Browse files Browse the repository at this point in the history
…s-bug

Return empty list when there is no matching resource instsnce items  …
  • Loading branch information
k8s-ci-robot authored Nov 29, 2023
2 parents 36cfbe6 + 5194426 commit 1992802
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 1992802

Please sign in to comment.