[AKS] az aks update: Fix --outbound-type validation for UDR and userAssignedNATGateway#33694
Open
FumingZhang wants to merge 2 commits into
Open
[AKS] az aks update: Fix --outbound-type validation for UDR and userAssignedNATGateway#33694FumingZhang wants to merge 2 commits into
az aks update: Fix --outbound-type validation for UDR and userAssignedNATGateway#33694FumingZhang wants to merge 2 commits into
Conversation
…serAssignedNATGateway
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes az aks update --outbound-type validation so UPDATE mode no longer requests the non-existent --vnet-subnet-id argument when migrating to userDefinedRouting/userAssignedNATGateway. Instead, it raises a clear InvalidArgumentValueError explaining that migration is only supported for clusters using a custom (BYO) VNet; CREATE mode keeps the existing “missing required arg” behavior.
Changes:
- Add UPDATE-mode-specific validation for
userDefinedRoutinganduserAssignedNATGatewaywhen no subnet is available, producing an actionable error for managed VNet clusters. - Add/extend unit tests covering UPDATE-mode success/failure scenarios for outbound type validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py |
Adjusts outbound-type validation to emit a clear UPDATE-mode error for managed VNet clusters instead of referencing --vnet-subnet-id. |
src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py |
Adds tests for UPDATE-mode outbound-type validation paths (BYO subnet present vs absent). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
AKS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related command
az aks update --outbound-typeDescription
Fixes #33204.
az aks update --outbound-type userDefinedRouting/userAssignedNATGatewayincorrectly required--vnet-subnet-id, which is not registered foraks update, creating an impossible state for users.Changes in
AKSManagedClusterContext._get_outbound_type:InvalidArgumentValueErrorexplaining that migrating touserDefinedRouting/userAssignedNATGatewayis only supported for BYO (custom) VNet clusters, instead of asking for the non-existent--vnet-subnet-idargument.RequiredArgumentMissingErrorbehavior.This mirrors Azure/azure-cli-extensions#9792 for the built-in
acsmodule.Testing Guide
az aks update -g <rg> -n <cluster> --outbound-type userDefinedRoutingsucceeds without--vnet-subnet-id.History Notes
[AKS]
az aks update: Fix--outbound-typevalidation foruserDefinedRoutinganduserAssignedNATGatewayso BYO VNet clusters no longer require--vnet-subnet-idand managed VNet clusters get a clear error message