Skip to content

Gsuen/ndp create#9960

Open
GiMoney wants to merge 2 commits into
Azure:mainfrom
GiMoney:gsuen/ndp-create
Open

Gsuen/ndp create#9960
GiMoney wants to merge 2 commits into
Azure:mainfrom
GiMoney:gsuen/ndp-create

Conversation

@GiMoney

@GiMoney GiMoney commented Jun 21, 2026

Copy link
Copy Markdown

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (azdev required; see .azure-pipelines/templates/azdev_setup.yml for the install command until azdev==0.2.11b1 is on PyPI)
  • My extension version conforms to the Extension version schema

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.json automatically.
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.

Gi Suen and others added 2 commits June 19, 2026 13:47
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>
@GiMoney GiMoney requested a review from FumingZhang as a code owner June 21, 2026 00:16
Copilot AI review requested due to automatic review settings June 21, 2026 00:16
@azure-client-tools-bot-prd

Copy link
Copy Markdown
Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @GiMoney,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) on az aks create and wires it into managed cluster construction.
  • Implements decorator logic to populate nodeDisruptionProfile.nodeDisruptionPolicy on the outgoing ManagedCluster.
  • 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.",
)
@yonzhan

yonzhan commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

AKS

@GiMoney GiMoney force-pushed the gsuen/ndp-create branch from f7979fc to 665eab3 Compare June 21, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants