-
Notifications
You must be signed in to change notification settings - Fork 3.4k
az aks nodepool upgrade silently drops --max-unavailable flag #33195
Copy link
Copy link
Open
Labels
AKSaz aks/acs/openshiftaz aks/acs/openshiftAuto-AssignAuto assign by botAuto assign by botLanguageService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.Similar-Issueact-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.
Metadata
Metadata
Assignees
Labels
AKSaz aks/acs/openshiftaz aks/acs/openshiftAuto-AssignAuto assign by botAuto assign by botLanguageService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.Similar-Issueact-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.
Describe the bug
az aks nodepool upgrade --max-unavailableaccepts the flag, validates it, and documents it in help text, but never applies it to the agent pool before sending the PUT request. The value is silently dropped.Related command
(from https://learn.microsoft.com/en-us/azure/aks/stateful-workload-upgrades#step-3-upgrade-node1-former-primary)
az aks nodepool upgrade \ --resource-group myRG \ --cluster-name myCluster \ --name myPool \ --kubernetes-version 1.29.0 \ --max-surge 0 \ --max-unavailable 1Errors
This bug would not produce any error message.
Issue script & Debug output
This issue was discovered through code review of
dev.Expected behavior
az aks nodepool upgradeshould pass--max-unavailablethrough to the PUT request.Environment Summary
This issue was discovered through code review of
dev.Additional context
Line numbers below are as of adb78953b2b0c0debe5be51aa02262baacba0626.
Root cause
--max-unavailablewas added in #31510 (commit cb14a97). That PR correctly wired upmax_unavailablein:custom.py, line 3087)--node-image-onlymutual-exclusivity check (custom.py, line 3110)_help.py, line 2195)_params.py, line 1134)nodepool addandnodepool updatedecorators (agentpool_decorator.py, lines 2036–2038 and 2518–2520)But
aks_agentpool_upgrade()incustom.pydoes not use the decorator pattern — it directly assigns upgrade settings to the instance (lines 3159–3169). The assignment formax_unavailablewas never added:The test added in #31510 covers
nodepool addandnodepool updatebut explicitly skipsnodepool upgrade(# actually running an upgrade is too expensive for these tests.).Fix
Add the missing assignment after line 3169: