Skip to content

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

Open
nirnaymsft wants to merge 16 commits into
Azure:mainfrom
nirnaymsft:patch-1
Open

Update azure Policy key under addonProfiles matching Azure Portal casing#8495
nirnaymsft wants to merge 16 commits into
Azure:mainfrom
nirnaymsft:patch-1

Conversation

@nirnaymsft
Copy link
Copy Markdown

@nirnaymsft nirnaymsft commented Feb 20, 2025

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
@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 20, 2025

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

@github-actions
Copy link
Copy Markdown
Contributor

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>

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 20, 2025

@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@FumingZhang
Copy link
Copy Markdown
Member

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

Comment thread src/aks-preview/azext_aks_preview/_consts.py Outdated
Comment thread src/aks-preview/HISTORY.rst
@nirnaymsft
Copy link
Copy Markdown
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
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 21, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@fseldow
Copy link
Copy Markdown
Contributor

fseldow commented Feb 21, 2025

/lgtm

Comment thread src/aks-preview/azext_aks_preview/_consts.py Outdated
Comment thread src/aks-preview/azext_aks_preview/_consts.py Outdated
@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Copy Markdown
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?

Comment thread src/aks-preview/azext_aks_preview/custom.py
@github-actions github-actions Bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Feb 25, 2025
@github-actions github-actions Bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Feb 25, 2025
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Feb 25, 2025

Please fix conflicts

assert not addon["enabled"]

disable_cmd = (
"aks aks --resource-group={resource_group} --name={name} "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo here?

assert not addon["enabled"]

update_cmd = (
"aks aks --resource-group={resource_group} --name={name} "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

another typo?

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