@@ -93,21 +93,28 @@ def aks_namespace_list_table_format(results):
9393
9494
9595def _aks_namespace_list_table_format (result ):
96- parsed = compile_jmes ("""{
97- name: name,
98- tags: to_string(tags),
99- provisioningState: to_string(properties.provisioningState),
100- labels: to_string(properties.labels),
101- annotations: to_string(properties.annotations),
102- cpuRequest: to_string(properties.defaultResourceQuota.cpuRequest),
103- cpuLimit: to_string(properties.defaultResourceQuota.cpuLimit),
104- memoryRequest: to_string(properties.defaultResourceQuota.memoryRequest),
105- memoryLimit: to_string(properties.defaultResourceQuota.memoryLimit),
106- ingress: to_string(properties.defaultNetworkPolicy.ingress),
107- egress: to_string(properties.defaultNetworkPolicy.egress),
108- adoptionPolicy: to_string(properties.adoptionPolicy),
109- deletePolicy: to_string(properties.deletePolicy)
110- }""" )
96+ if not result .get ("properties" ):
97+ parsed = compile_jmes ("""{
98+ name: name,
99+ resourceGroup: resourceGroup,
100+ location: location
101+ }""" )
102+ else :
103+ parsed = compile_jmes ("""{
104+ name: name,
105+ tags: to_string(tags),
106+ provisioningState: to_string(properties.provisioningState),
107+ labels: to_string(properties.labels),
108+ annotations: to_string(properties.annotations),
109+ cpuRequest: to_string(properties.defaultResourceQuota.cpuRequest),
110+ cpuLimit: to_string(properties.defaultResourceQuota.cpuLimit),
111+ memoryRequest: to_string(properties.defaultResourceQuota.memoryRequest),
112+ memoryLimit: to_string(properties.defaultResourceQuota.memoryLimit),
113+ ingress: to_string(properties.defaultNetworkPolicy.ingress),
114+ egress: to_string(properties.defaultNetworkPolicy.egress),
115+ adoptionPolicy: to_string(properties.adoptionPolicy),
116+ deletePolicy: to_string(properties.deletePolicy)
117+ }""" )
111118 # use ordered dicts so headers are predictable
112119 return parsed .search (result , Options (dict_cls = OrderedDict ))
113120
0 commit comments