-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add additional validations for commands az aks extension type list and az aks extension type version list #8937
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
add additional validations for commands az aks extension type list and az aks extension type version list #8937
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
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>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds argument validation for the az aks extension type list and az aks extension type version list commands when neither location nor both resource group/name are provided, alongside version bump and documentation updates.
- Bump extension version to 18.0.0b18
- Add a new validator in
_validators.pyenforcing--locationor--cluster&--resource-group-name - Update HISTORY, README troubleshooting example, and add JSON-based checks for connectedk8s troubleshooting
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/connectedk8s/azext_connectedk8s/troubleshoot.json | Add new checks for Helm installation, version, and Azure permissions |
| src/connectedk8s/README.md | Add az connectedk8s troubleshoot example |
| src/aks-preview/setup.py | Bump extension version to 18.0.0b18 |
| src/aks-preview/azext_aks_preview/_validators.py | Enforce missing-parameter validation for location/cluster flags |
| src/aks-preview/HISTORY.rst | Document the new validation behavior under version 18.0.0b18 |
Comments suppressed due to low confidence (3)
src/aks-preview/azext_aks_preview/_validators.py:969
- The error message refers to
--resource-groupbut the parameter is named--resource-group-name. Please update the message to the correct flag name.
"You must specify --location or --resource-group and --cluster."
src/connectedk8s/README.md:60
- The code block for the troubleshoot example isn’t closed or fully shown. Add a closing ``` and ensure the full command (including any flags or output) is provided.
--name my-cluster \
src/connectedk8s/azext_connectedk8s/troubleshoot.json:23
- The fail message ends with a colon but doesn’t include the actual command. Consider appending the recommended
az role assignmentcommand or instructions here.
"FailMessage": "Please use the following command to get the correct permissions: ",
| location = namespace.location | ||
| resource_group_name = namespace.resource_group_name | ||
| cluster_name = namespace.cluster_name | ||
| if not namespace.location and not namespace.cluster_name and not namespace.resource_group_name: |
Copilot
AI
Jul 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition only fires when all three flags are missing. It doesn’t catch cases where only one of --resource-group-name or --cluster is provided without the other. Consider adding a separate check to require both or to use XOR logic when location is absent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That check already exists below...
| +++++++ | ||
| 18.0.0b18 | ||
| +++++++ | ||
| * Add validation error when neither --location or --cluster and --resource-group-name are specified for az extension type list or az extension type version list |
Copilot
AI
Jul 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The phrasing is unclear. Consider rewording to: “Add validation error when neither --location nor both --cluster and --resource-group-name are specified.”
| * Add validation error when neither --location or --cluster and --resource-group-name are specified for az extension type list or az extension type version list | |
| * Add validation error when neither --location nor both --cluster and --resource-group-name are specified for az extension type list or az extension type version list |
|
|
+@FumingZhang could you please help to review this PR as well? |
|
[Release] Update index.json for extension [ aks-preview-18.0.0b18 ] : https://dev.azure.com/msazure/One/_build/results?buildId=129329668&view=results |
This PR adds validation error when neither --location or --cluster and --resource-group-name parameters are specified for the commands az extension type list or az extension type version list
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
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.