Skip to content

Conversation

@xmzhao0822
Copy link
Contributor


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

Related command

az aks namespace add
az aks namespace update

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.

Copilot AI review requested due to automatic review settings June 2, 2025 22:02
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jun 2, 2025

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

@azure-client-tools-bot-prd
Copy link

Hi @xmzhao0822,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 2, 2025

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

@github-actions
Copy link

github-actions bot commented Jun 2, 2025

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
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR populates managed namespace resources with the location of their parent AKS cluster by fetching and assigning the cluster’s location in both add and update commands.

  • Fetch the AKS cluster location in aks_managed_namespace_add and aks_managed_namespace_update.
  • Assign the cluster’s location to the location field on namespace_config.
  • Adjust tests to mock get_mgmt_service_client and simulate cluster location.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/aks-preview/azext_aks_preview/tests/latest/test_managednamespace.py Added get_mgmt_service_client patch and mock cluster client in tests to simulate location.
src/aks-preview/azext_aks_preview/managednamespace.py Imported client factory & cluster client, fetched the cluster’s location, and set namespace_config.location in both add/update commands.
Comments suppressed due to low confidence (1)

src/aks-preview/azext_aks_preview/managednamespace.py:43

  • The new location property assignment isn't covered by any tests. Add tests to verify that namespace_config.location is correctly set based on the cluster's location.
namespace_config.location = cluster_location

@github-actions
Copy link

github-actions bot commented Jun 2, 2025

@xmzhao0822 xmzhao0822 changed the title {AKS} populate location of managed namespaces using managed cluster location {AKS} populate location of managed namespaces using managed cluster's location Jun 2, 2025
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

Queued live test to validate the change.

  • test_aks_managed_namespace

@FumingZhang
Copy link
Member

lgtm

Queued live test to validate the change.

  • test_aks_managed_namespace

live test failed with the following error

E azure.core.exceptions.ResourceExistsError: (CannotDeleteResource) Cannot delete resource while nested resources exist. Some existing nested resource IDs include: 'Microsoft.ContainerService/managedClusters/cliakstestvx3ffn/managedNamespaces/namespace01'. Please delete all nested resources before deleting this resource.
E Code: CannotDeleteResource
E Message: Cannot delete resource while nested resources exist. Some existing nested resource IDs include: 'Microsoft.ContainerService/managedClusters/cliakstestvx3ffn/managedNamespaces/namespace01'. Please delete all nested resources before deleting this resource.

@FumingZhang
Copy link
Member

due to change in Azure/azure-cli#31589, the CI checks failed, could you please replace 2024-07-01 with 2022-09-01 in file src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_create_and_update_outbound_ips.yaml

…preview/tests/latest/recordings/test_aks_create_and_update_outbound_ips.yaml
FumingZhang
FumingZhang previously approved these changes Jun 3, 2025
@FumingZhang
Copy link
Member

live test passed

FumingZhang
FumingZhang previously approved these changes Jun 3, 2025
@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 Jun 3, 2025
zhoxing-ms
zhoxing-ms previously approved these changes Jun 3, 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 Jun 3, 2025
@zhoxing-ms zhoxing-ms merged commit b406fb1 into Azure:main Jun 3, 2025
24 checks passed
@azclibot
Copy link
Collaborator

azclibot commented Jun 3, 2025

[Release] Update index.json for extension [ aks-preview-18.0.0b8 ] : https://dev.azure.com/msazure/One/_build/results?buildId=126094133&view=results

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.

6 participants