Skip to content

Fixing bug in az fleet namespace get-credentials command#9383

Merged
zhoxing-ms merged 2 commits intoAzure:mainfrom
audrastump:stumpaudra/getcredentials
Nov 6, 2025
Merged

Fixing bug in az fleet namespace get-credentials command#9383
zhoxing-ms merged 2 commits intoAzure:mainfrom
audrastump:stumpaudra/getcredentials

Conversation

@audrastump
Copy link
Copy Markdown
Member


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 --member command.

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 November 4, 2025 03:19
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Nov 4, 2025

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Nov 4, 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

github-actions bot commented Nov 4, 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>

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

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

Comment thread src/fleet/azext_fleet/custom.py Outdated
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
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.

make this case-insensitive
i.e: call .lower() on the left side of the equality

Copy link
Copy Markdown
Member Author

@audrastump audrastump Nov 4, 2025

Choose a reason for hiding this comment

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

Updated!

@audrastump
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Nov 4, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@zhoxing-ms zhoxing-ms merged commit 26d21d0 into Azure:main Nov 6, 2025
25 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

azclibot commented Nov 6, 2025

[Release] Update index.json for extension [ fleet-1.8.2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=142828508&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants