[AKS] az aks update: Fix --outbound-type validation for UDR and userAssignedNATGateway#33694
[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#33694Conversation
…serAssignedNATGateway
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
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.
|
AKS |
Sebby37
left a comment
There was a problem hiding this comment.
Approving the code, the fix and its test coverage look correct, and this matches the merged extensions counterpart (#9792) for issue #33204.
On the failing Load extensions job: this looks unrelated to this change. All the errors are in storage-preview extensions (Python 3.14 import incompatibilities), and the CLI self-test itself passes (exit 0) the bash step fails on something outside this diff's scope. A re-run reproduced the identical failure, so it appears to be a pre-existing/environmental break rather than flake. Since this PR only touches acs, I don't think it's the cause. Can a maintainer confirm whether this is a known CI issue and advise on how to proceed with the merge gate?
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