Fixing bug in az fleet namespace get-credentials command#9383
Fixing bug in az fleet namespace get-credentials command#9383zhoxing-ms merged 2 commits intoAzure:mainfrom
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the fleet get-credentials command when used with the fleet member parameter. The issue was that resource type and namespace comparisons were case-sensitive, but Azure's parse_resource_id function returns these values in lowercase, causing the validation to incorrectly fail for valid AKS managed clusters.
- Updated resource type comparison from 'managedClusters' to 'managedclusters' (lowercase)
- Updated namespace comparison from 'Microsoft.ContainerService' to 'microsoft.containerservice' (lowercase)
- Incremented version from 1.8.1 to 1.8.2
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/fleet/setup.py | Bumped version to 1.8.2 |
| src/fleet/azext_fleet/custom.py | Fixed case sensitivity issue in resource type and namespace validation |
| src/fleet/HISTORY.rst | Added changelog entry for version 1.8.2 |
| parsed_id = parse_resource_id(fleet_member.cluster_resource_id) | ||
| if (parsed_id.get('resource_type') != 'managedClusters' or | ||
| parsed_id.get('namespace') != 'Microsoft.ContainerService'): | ||
| if (parsed_id.get('resource_type') != 'managedclusters' or |
There was a problem hiding this comment.
make this case-insensitive
i.e: call .lower() on the left side of the equality
|
/azp run |
|
Commenter does not have sufficient privileges for PR 9383 in repo Azure/azure-cli-extensions |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
[Release] Update index.json for extension [ fleet-1.8.2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=142828508&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
Fixing bug "Fleet member '{member_name}' is not associated with an AKS managed cluster" returning on managed clusters during
az fleet namespace get-credentials --membercommand.General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)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.jsonautomatically.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.