azure-cli-extensions
azure-cli-extensions copied to clipboard
az aks mesh get-upgrades fails with a traceback if Istio AKS addon is disabled
Describe the bug
Calling az aks mesh get-upgrades -g my-rg --name my-aks fails with a traceback when the Istio AKS add-on is disabled.
Related command
Calling `az aks mesh get-upgrades -g my-rg --name my-aks
Errors
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 729, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 698, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/Users/saverioproto/.azure/cliextensions/aks-preview/azext_aks_preview/custom.py", line 2907, in aks_mesh_get_upgrades
for page in upgradeProfiles.by_page():
File "/opt/homebrew/Cellar/azure-cli/2.57.0/libexec/lib/python3.11/site-packages/azure/core/paging.py", line 83, in __next__
self.continuation_token, self._current_page = self._extract_data(self._response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/saverioproto/.azure/cliextensions/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2023_10_02_preview/operations/_managed_clusters_operations.py", line 4442, in extract_data
return deserialized.next_link or None, iter(list_of_elem)
^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
To check existing issues, please visit:
https://github.com/Azure/azure-cli/issues
Issue script & Debug output
n/a
Expected behavior
It should fail or print an error without traceback.
Environment Summary
azure-cli 2.57.0
core 2.57.0 telemetry 1.1.0
Extensions: account 0.2.5 aks-preview 1.0.0b5 alb 1.0.0 amg 1.2.9 containerapp 0.3.44 costmanagement 0.2.1 fleet 1.0.1 front-door 1.0.17 k8s-extension 1.6.0 monitor-control-service 0.4.1 rdbms-connect 1.0.4 serial-console 0.1.6
Dependencies: msal 1.26.0 azure-mgmt-resource 23.1.0b2
Additional context
No response
Thank you for opening this issue, we will look into it.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dyu1208, @FumingZhang, @andyliuliming.
The result returned by the server is not valid, should be an empty list instead of null.
@deveshdama will take a further look
This fix has been released as part of extension aks-preview version 2.0.0b3.