[AKS] az aks update: Fix --outbound-type validation for UDR and userAssignedNATGateway#33214
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
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>
|
…Gateway Fixes Azure#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
42447fe to
06649a9
Compare
a0x1ab
left a comment
There was a problem hiding this comment.
🤖 AI Agent | This comment was posted automatically by the GitHub Copilot agent assist loop.
Tester Agent — Test Results: PASS
Ran validation tests locally against the PR logic (Azure VM provisioning was skipped due to missing service principal credentials in this environment).
Tests executed:
| # | Scenario | Expected | Result |
|---|---|---|---|
| 1 | az aks update --outbound-type userDefinedRouting (no BYO subnet, UPDATE mode) |
InvalidArgumentValueError |
✅ PASS |
| 2 | az aks create --outbound-type userDefinedRouting (no subnet, CREATE mode) |
RequiredArgumentMissingError |
✅ PASS |
| 3 | az aks update --outbound-type userDefinedRouting --vnet-subnet-id <id> (UPDATE + BYO VNet) |
Returns userDefinedRouting |
✅ PASS |
| 4 | az aks update --outbound-type userAssignedNATGateway (no BYO subnet, UPDATE mode) |
InvalidArgumentValueError |
✅ PASS |
Analysis:
- The fix correctly differentiates CREATE vs UPDATE decorator modes
- UPDATE mode without a BYO VNet subnet now gives a clear, actionable
InvalidArgumentValueErrorinstead of the misleadingRequiredArgumentMissingErrorasking for--vnet-subnet-id - CREATE mode behavior is unchanged
- The
@staticmethoddecorator was correctly removed to allowself.decorator_modeaccess
Reviewer: Approving this PR ✔️
Related command
az aks updateDescription
Fixes #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:
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.