Merge pull request #2155 from dirrao/2142-dynamic-client-empty-results-bug

Return empty list when there is no matching resource instsnce items  …
This commit is contained in:
Kubernetes Prow Robot 2023-11-29 03:27:14 +01:00 committed by GitHub
commit 19928029d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -291,6 +291,8 @@ class ResourceInstance(object):
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']