{AKS} az aks update: Fix --outbound-type validation for UDR and userAssignedNATGateway#9792
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
Hi @FumingZhang, |
|
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>
|
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
|
Hi @FumingZhang Release SuggestionsModule: aks-preview
Notes
|
There was a problem hiding this comment.
Pull request overview
Fixes az aks update --outbound-type validation so updating to userDefinedRouting / userAssignedNATGateway no longer incorrectly requires --vnet-subnet-id (which isn’t registered for update), and instead emits a clear error for unsupported managed-VNet clusters.
Changes:
- Adjust outbound type validation to raise
InvalidArgumentValueError(UPDATE) vsRequiredArgumentMissingError(CREATE) whenvnet_subnet_idis absent. - Add unit tests for update/create validation scenarios around UDR and user-assigned NAT gateway.
- Document the behavior change in
HISTORY.rst.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/aks-preview/azext_aks_preview/managed_cluster_decorator.py |
Updates outbound-type validation logic to differentiate CREATE vs UPDATE behavior when subnet info is missing. |
src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py |
Adds tests covering update/create paths for UDR and userAssignedNATGateway. |
src/aks-preview/HISTORY.rst |
Adds changelog entry describing the improved update-time error behavior. |
…Gateway Fixes Azure/azure-cli#33204 The CLI incorrectly required --vnet-subnet-id when updating outbound type to userDefinedRouting or userAssignedNATGateway. This parameter is not registered for 'aks update', creating an impossible state for users. Changes: - In UPDATE mode, when vnet_subnet_id is empty, raise a clear InvalidArgumentValueError explaining that updating to UDR/ userAssignedNATGateway is only supported for BYO VNet clusters - In CREATE mode, preserve existing RequiredArgumentMissingError - For BYO VNet clusters, the subnet is already known from the agentpool, so validation passes and the update works correctly - Added 4 unit tests covering CREATE and UPDATE scenarios
aks update: Fix --outbound-type validation for UDR and userAssignedNATGatewayaz aks update: Fix --outbound-type validation for UDR and userAssignedNATGateway
d53fbd0 to
12e9a42
Compare
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
Fixes Azure/azure-cli#33204
The CLI incorrectly required --vnet-subnet-id when updating outbound type to userDefinedRouting or userAssignedNATGateway. This parameter is not registered for 'aks update', creating an impossible state for users.
Changes:
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.