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

Update azure Policy key under addonProfiles matching Azure Portal casing #8495

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nirnaymsft
Copy link

When user enable policy via Portal the key added to addonProfiles is azurePolicy. Matching name in CLI as well.


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aks enable-addons
az aks addon list

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

nirnaymsft and others added 2 commits February 19, 2025 15:35
When user enable policy via Portal the key added to addonProfiles is azurePolicy
Copy link

azure-client-tools-bot-prd bot commented Feb 20, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 20, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link

github-actions bot commented Feb 20, 2025

@FumingZhang
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@FumingZhang
Copy link
Member

@nirnaymsft, may I ask what's the motivation to update the value? cc @fseldow

@nirnaymsft
Copy link
Author

@nirnaymsft, may I ask what's the motivation to update the value? cc @fseldow

This is customer raised issue. The RCA showed that, Enabling Azure Policy via CLI and Portal is causing different behavior in name of azurepolicy under addonProfiles object.
image

@nirnaymsft nirnaymsft closed this Feb 21, 2025
@nirnaymsft nirnaymsft reopened this Feb 21, 2025
@nirnaymsft
Copy link
Author

/azp run

Copy link

Commenter does not have sufficient privileges for PR 8495 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 21, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@fseldow
Copy link
Contributor

fseldow commented Feb 21, 2025

/lgtm

@@ -150,7 +150,7 @@
CONST_KUBE_DASHBOARD_ADDON_NAME = "kubeDashboard"

# azure policy
CONST_AZURE_POLICY_ADDON_NAME = "azurepolicy"
CONST_AZURE_POLICY_ADDON_NAME = "azurePolicy"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can revert this change now.

@FumingZhang
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

but I have a question about if the goal is to fix the case issue in command az aks enable-addons and az aks addon enable only, user could also enable the policy addon when creating the cluster, do you want to fix the issue in that command too?

addon_key in mc.addon_profiles and
mc.addon_profiles[addon_key].enabled
)
enabled = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some existing test cases that create the AKS cluster with policy addon enabled, maybe you can modify one of those case to validate the change?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants