[AKS] Skip subnet validation for existing outbound type on update#33418
[AKS] Skip subnet validation for existing outbound type on update#33418wenhug wants to merge 1 commit into
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @wenhug, |
️✔️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>
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adjusts outbound type validation so update scenarios that read outbound_type from the existing ManagedCluster don’t incorrectly require --vnet-subnet-id, and adds a regression test for that case.
Changes:
- Skip the “missing vnet subnet” validation when
outbound_typeis sourced from the existingmcobject. - Add a unit test covering
userAssignedNATGatewayoutbound type with no vnet subnet in UPDATE mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py | Adds a regression test ensuring UPDATE mode can read outbound_type from mc without requiring a subnet. |
| src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py | Updates outbound type validation logic to skip subnet requirement when the value is read from the existing cluster. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
| ctx_14_0 = AKSManagedClusterContext( | ||
| self.cmd, | ||
| AKSManagedClusterParamDict({"sku": "base"}), |
| if not read_from_mc and self.get_vnet_subnet_id() in ["", None] and not byo_subnets_set: | ||
| self._raise_missing_vnet_subnet_for_outbound_type(outbound_type, skuName) |
Summary
Testing
python3 -m pytest src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py -k 'test_get_outbound_type or test_update_outbound_type' -q\n -2 passed, 266 deselected