[AKS] az aks nodepool rollback: Add rollback commands#33509
Open
InduSridhar wants to merge 1 commit into
Open
Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| aks nodepool get-rollback-versions | cmd aks nodepool get-rollback-versions added |
||
| aks nodepool rollback | cmd aks nodepool rollback added |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds new AKS nodepool rollback functionality to expose rollback history and roll back a node pool to its most recently used version.
Changes:
- Introduces
az aks nodepool get-rollback-versionsto list rollback candidates. - Introduces
az aks nodepool rollbackto roll back to the most recent (N-1) version. - Adds help text, table output formatting, and release notes entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acs/custom.py | Implements rollback versions retrieval and rollback operation logic |
| src/azure-cli/azure/cli/command_modules/acs/commands.py | Wires new commands into the command table and table formatter |
| src/azure-cli/azure/cli/command_modules/acs/_params.py | Adds parameter context for the new rollback command |
| src/azure-cli/azure/cli/command_modules/acs/_help.py | Documents new commands and parameters |
| src/azure-cli/azure/cli/command_modules/acs/_format.py | Adds table transformer for rollback versions output |
| src/azure-cli/HISTORY.rst | Mentions new commands in release history |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3157
to
+3161
| sorted_versions = sorted( | ||
| upgrade_profile.recently_used_versions, | ||
| key=lambda version: version.timestamp if version.timestamp else datetime.datetime.min, | ||
| reverse=True, | ||
| ) |
Comment on lines
+3139
to
+3146
| if upgrade_channel_enabled or node_os_channel_enabled: | ||
| logger.warning( | ||
| "Auto-upgrade is enabled on cluster '%s' (upgradeChannel=%s, nodeOSUpgradeChannel=%s). " | ||
| "Rollback will not succeed until auto-upgrade is disabled. Please disable auto-upgrade to roll back the node pool.", | ||
| cluster_name, | ||
| upgrade_channel or "none", | ||
| node_os_upgrade_channel or "Unmanaged", | ||
| ) |
Comment on lines
+44
to
+52
| def _format_rollback_version(result): | ||
| parsed = compile_jmes("""{ | ||
| kubernetesVersion: orchestratorVersion, | ||
| nodeImageVersion: nodeImageVersion, | ||
| timestamp: timestamp | ||
| }""") | ||
| return parsed.search(result, Options(dict_cls=OrderedDict)) | ||
|
|
||
| return [_format_rollback_version(r) for r in results] |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4165ddc to
137c671
Compare
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 nodepool get-rollback-versionsaz aks nodepool rollbackDescription
This PR adds GA Azure CLI support for AKS agentpool rollback, matching the aks-preview extension implementation for the 2026-04 GA API surface.
Changes:
az aks nodepool get-rollback-versionsto returnrecently_used_versionsfrom the agent pool upgrade profile.az aks nodepool rollbackto roll back an agent pool to the most recently used Kubernetes and node image version.Testing Guide
Added unit coverage in
azure.cli.command_modules.acs.tests.latest.test_customfor:begin_create_or_update.CLIErrorwhen no rollback history is available.PR validation status:
Azure.azure-cli Full Testsucceeded.azdev-lintersucceeded.azdev-stylesucceeded.Azure.azure-cli Breaking Change Testsucceeded.git diff --checksucceeded.Python tests were not run locally because Python is not installed in this environment.
History Notes
[AKS]
az aks nodepool get-rollback-versions,az aks nodepool rollback: Add commands to get rollback versions and roll back an agent pool to the most recently used configuration.This 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.