Gsuen/ndp create#9960
Open
GiMoney wants to merge 2 commits into
Open
Conversation
PR Azure#9893 added --node-disruption-policy only to `az aks update`, so the flag was rejected at `az aks create` time. Wire the same node disruption policy plumbing into the create path: register the argument on the `aks create` context, thread node_disruption_policy through aks_create(), and add set_up_node_disruption_policy() to the create decorator so the nodeDisruptionProfile.nodeDisruptionPolicy property is set on the created managed cluster. Add a create-path scenario test and changelog entry. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Cassette generated by the AZCLI AKS LIVE TEST V2 - [AKS-PREVIEW] pipeline (run 168872338, eastus2euap, sub with NodeDisruptionProfile feature registered). Live and live-replay both passed. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @GiMoney, |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support in the aks-preview extension for setting AKS node disruption policy at cluster creation time via a new preview argument, and validates the behavior with a new live test + recording.
Changes:
- Exposes
--node-disruption-policy(preview) onaz aks createand wires it into managed cluster construction. - Implements decorator logic to populate
nodeDisruptionProfile.nodeDisruptionPolicyon the outgoingManagedCluster. - Adds a new live test and recording covering create-time policy and a blocked update scenario.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/aks-preview/HISTORY.rst | Documents the new az aks create --node-disruption-policy preview capability. |
| src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py | Adds a live test for create-time node disruption policy behavior. |
| src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_create_node_disruption_policy.yaml | Recording for the new live test scenario. |
| src/aks-preview/azext_aks_preview/managed_cluster_decorator.py | Adds create-time setup for nodeDisruptionProfile.nodeDisruptionPolicy and hooks it into profile construction. |
| src/aks-preview/azext_aks_preview/custom.py | Adds node_disruption_policy parameter to aks_create raw parameters flow. |
| src/aks-preview/azext_aks_preview/_params.py | Adds the node_disruption_policy argument to aks create context. |
Comment on lines
+5094
to
+5098
| def set_up_node_disruption_policy(self, mc: ManagedCluster) -> ManagedCluster: | ||
| """Set up the nodeDisruptionPolicy field of the managed cluster | ||
|
|
||
| :return: the ManagedCluster object | ||
| """ |
Comment on lines
+1241
to
+1246
| c.argument( | ||
| "node_disruption_policy", | ||
| arg_type=get_enum_type(node_disruption_policies), | ||
| is_preview=True, | ||
| help="Set the node disruption policy for the cluster.", | ||
| ) |
Collaborator
|
AKS |
f7979fc to
665eab3
Compare
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.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (azdevrequired; see.azure-pipelines/templates/azdev_setup.ymlfor the install command untilazdev==0.2.11b1is on PyPI)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.