Return empty list when there is no matching resource instsnce items to return

This commit is contained in:
gopal 2023-11-28 13:15:30 +05:30 committed by gopal
parent 36cfbe68a5
commit 51944266f3

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']