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

az aks update --enable-defender doesn't work with aks-preview extension #5092

Closed
TomGeske opened this issue Jul 8, 2022 · 7 comments
Closed
Assignees
Labels
AKS Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue.

Comments

@TomGeske
Copy link

TomGeske commented Jul 8, 2022

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az aks update Extension Name: aks-preview. Version: 0.5.87.

Errors:

The command failed with an unexpected error. Here is the traceback:
'AKSPreviewManagedClusterModels' object has no attribute 'ManagedClusterSecurityProfileAzureDefender'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 231, 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 "/home/thomasge/.azure/cliextensions/aks-preview/azext_aks_preview/custom.py", line 798, in aks_update
    mc = aks_update_decorator.update_mc_profile_preview()
  File "/home/thomasge/.azure/cliextensions/aks-preview/azext_aks_preview/managed_cluster_decorator.py", line 1942, 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 5631, in update_mc_profile_default
    mc = self.update_defender(mc)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/acs/managed_cluster_decorator.py", line 5552, in update_defender
    defender = self.context.get_defender_config()
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/acs/managed_cluster_decorator.py", line 3672, in get_defender_config
    azure_defender = self.models.ManagedClusterSecurityProfileAzureDefender(enabled=enable_defender)
AttributeError: 'AKSPreviewManagedClusterModels' object has no attribute 'ManagedClusterSecurityProfileAzureDefender'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az aks update --enable-defender -g {} -n {}

Expected Behavior

Environment Summary

Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.35, Ubuntu 22.04 LTS
Python 3.10.5
Installer: DEB

azure-cli 2.38.0

Extensions:
subscription 0.1.5
containerapp 0.3.7
aks-preview 0.5.87
account 0.2.3

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

@ghost ghost added AKS CXP Attention This issue is handled by CXP team. Auto-Assign Auto assign by bot labels Jul 8, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 8, 2022

route to CXP team

@navba-MSFT navba-MSFT self-assigned this Jul 11, 2022
@navba-MSFT
Copy link
Contributor

@TomGeske Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

@navba-MSFT navba-MSFT added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 11, 2022
@navba-MSFT
Copy link
Contributor

@TomGeske The above PR has been created to address this issue. In the meantime, if you have any questions, please feel free to ask.

@TomGeske
Copy link
Author

@navba-MSFT: I see PR being merged. Kindly advise when the new aks-preview version becomes available for testing.

@navba-MSFT
Copy link
Contributor

@TomGeske This should be released in 2022-08-02 See this: https://github.com/Azure/azure-cli-extensions/milestone/69

@navba-MSFT navba-MSFT added the needs-author-feedback More information is needed from author to address the issue. label Jul 13, 2022
@navba-MSFT
Copy link
Contributor

@TomGeske We will now proceed with closure of this thread. Please feel free to reopen if you have any follow-up questions. We would be happy to help.

@FumingZhang
Copy link
Member

The issue is fixed in the latest version of aks-preview (0.5.91).

This problem can be solved by updating to the latest version of aks-preview without waiting for the new version of azure-cli release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue.
Projects
None yet
Development

No branches or pull requests

4 participants