Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManagedCluster' object has no attribute 'upgrade_settings' #27525

Open
ionutleca opened this issue Oct 5, 2023 · 7 comments
Open

ManagedCluster' object has no attribute 'upgrade_settings' #27525

ionutleca opened this issue Oct 5, 2023 · 7 comments
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@ionutleca
Copy link

Describe the bug

az aks update --name ** --resource-group ** --api-server-authorized-ip-ranges ** fails with az cli 2.53.0:

...
if mc.upgrade_settings is not None and mc.upgrade_settings.override_settings is not None and mc.upgrade_settings.override_settings.until is not None:
AttributeError: 'ManagedCluster' object has no attribute 'upgrade_settings'

Related command

az aks update --name ** --resource-group ** --api-server-authorized-ip-ranges **

Errors

ERROR: 'ManagedCluster' object has no attribute 'upgrade_settings'

Issue script & Debug output

WARNING: The behavior of this command has been altered by the following extension: aks-preview
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'ManagedCluster' object has no attribute 'upgrade_settings'
Traceback (most recent call last):
File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/opt/az/azcliextensions/aks-preview/azext_aks_preview/custom.py", line 832, in aks_update
mc = aks_update_decorator.update_mc_profile_preview()
File "/opt/az/azcliextensions/aks-preview/azext_aks_preview/managed_cluster_decorator.py", line 3198, in update_mc_profile_preview
mc = self.update_mc_profile_default()
File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/acs/managed_cluster_decorator.py", line 7336, in update_mc_profile_default
mc = self.update_upgrade_settings(mc)
File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/acs/managed_cluster_decorator.py", line 6458, in update_upgrade_settings
if mc.upgrade_settings is not None and mc.upgrade_settings.override_settings is not None and mc.upgrade_settings.override_settings.until is not None:
AttributeError: 'ManagedCluster' object has no attribute 'upgrade_settings'

Expected behavior

No error, it was working in az cli 2.52.0.

Environment Summary

azure-cli 2.53.0

core 2.53.0
telemetry 1.1.0

Extensions:
azure-devops 0.26.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Additional context

No response

@ionutleca ionutleca added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 5, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. AKS az aks/acs/openshift Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot labels Oct 5, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 5, 2023

Thank you for opening this issue, we will look into it.

@andyliuliming
Copy link
Member

andyliuliming commented Oct 8, 2023

+@FumingZhang @wenjungaogaogao to take a look

@wenjungaogaogao
Copy link
Contributor

Hello @ionutleca, could you check your aks-preview extension version?
The issue might happen if you are using latest azure-cli with aks-preview version prior 0.5.134.

$ az version
{
"azure-cli": "2.53.0",
"azure-cli-core": "2.53.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"aks-preview": "0.5.161",
"fleet": "0.2.2"
}
}

Please try update the extension version and let us know if the issue is still there. Thanks!

@ionutleca
Copy link
Author

Hi, @wenjungaogaogao, I tested with "aks-preview": "0.5.161" and it does seem to work.

Thank you!

@mmrazik
Copy link

mmrazik commented Oct 9, 2023

@wenjungaogaogao I actually somewhat disagree with this being closed. az-cli should be made more robust and handle version inconsistencies in a more robust way (instead of "crashing" like in this case it should tell the customer what is going on).

@mmrazik
Copy link

mmrazik commented Oct 9, 2023

And apparently this was not the first occurrence of such problem https://medium.com/@maciej.skorupka/azure-and-a-problem-with-az-cli-with-aks-preview-extension-583bc5ac55d4

@ionutleca
Copy link
Author

@mmrazik, I am the one that closed this because I found the fix for it. But I agree that it's not an ideal behaviour, version incompatibility between the core cli and it's extensions shouldn't be detected by users trying things out. I'll reopen this and let the azure-cli team handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants