Skip to content

Remove readOnly from nodeImageVersion in aks-preview agent pool models to unblock rollback#9736

Open
InduSridhar wants to merge 3 commits intoAzure:mainfrom
InduSridhar:fix/remove-nodeimageversion-readonly
Open

Remove readOnly from nodeImageVersion in aks-preview agent pool models to unblock rollback#9736
InduSridhar wants to merge 3 commits intoAzure:mainfrom
InduSridhar:fix/remove-nodeimageversion-readonly

Conversation

@InduSridhar
Copy link
Copy Markdown
Contributor

Description

The TypeSpec conversion in Azure/azure-rest-api-specs#38641 incorrectly re-added readOnly to the nodeImageVersion field in agent pool models. This was intentionally removed in Azure/azure-rest-api-specs#37229 to enable agentpool rollback functionality.

The upstream spec fix is tracked in Azure/azure-rest-api-specs#41598, but vendoring into the CLI may take a week or more. This is a temporary SDK-level workaround to unblock the rollback feature that is already in preview for customers.

Changes

Removes "node_image_version": {"readonly": True} from the vendored SDK _validation dict in:

  • AgentPool
  • ManagedClusterAgentPoolProfileProperties
  • ManagedClusterAgentPoolProfile

MachineProperties and Snapshot retain readonlynodeImageVersion is genuinely read-only on those resources.

Impact

Without this fix, the serializer strips nodeImageVersion from the PUT request body during agentpool rollback, causing the rollback to only update the orchestrator version while silently ignoring the node image version.

Related PRs

… rollback

The TypeSpec conversion in Azure/azure-rest-api-specs#38641 incorrectly
re-added readOnly to nodeImageVersion in agent pool models. This was
intentionally removed in Azure/azure-rest-api-specs#37229 to enable
agentpool rollback functionality.

The upstream spec fix is tracked in Azure/azure-rest-api-specs#41598 but
vendoring may take a week+. This is a temporary SDK-level workaround to
unblock the rollback feature that is already in preview for customers.

Removes readonly from nodeImageVersion in:
- AgentPool
- ManagedClusterAgentPoolProfileProperties
- ManagedClusterAgentPoolProfile

MachineProperties and Snapshot retain readonly as nodeImageVersion is
genuinely read-only on those resources.
Copilot AI review requested due to automatic review settings March 27, 2026 18:48
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Mar 27, 2026

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @InduSridhar,
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.

@github-actions
Copy link
Copy Markdown
Contributor

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Mar 27, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Copy Markdown
Contributor

Hi @InduSridhar

Release Suggestions

Module: aks-preview

  • Please log updates into to src/aks-preview/HISTORY.rst
  • Update VERSION to 19.0.0b29 in src/aks-preview/setup.py

Notes

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Temporary SDK-level workaround in aks-preview’s vendored AKS management client to allow nodeImageVersion to be sent on agent pool PUTs, unblocking nodepool rollback while waiting for the upstream swagger/spec fix.

Changes:

  • Removes readonly validation for node_image_version on AgentPool.
  • Removes readonly validation for node_image_version on ManagedClusterAgentPoolProfileProperties.
  • Removes readonly validation for node_image_version on ManagedClusterAgentPoolProfile.

@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@FumingZhang
Copy link
Copy Markdown
Member

There are several other places that need to be updated to pass the CI checks. You may refer to #9742 as an example.

Per reviewer feedback (FumingZhang), in addition to removing readonly
from _validation, the __init__ methods need to accept node_image_version
as a parameter and assign it instead of hardcoding None. Without this,
the serializer still cannot pass the value through during rollback.

Changes for AgentPool, ManagedClusterAgentPoolProfileProperties, and
ManagedClusterAgentPoolProfile (matching Azure#9742 pattern).
MachineProperties and Snapshot are unchanged (genuinely read-only).
@InduSridhar
Copy link
Copy Markdown
Contributor Author

InduSridhar commented Mar 30, 2026

Thanks @FumingZhang. Updated the PR to also make node_image_version a settable __init__ parameter (instead of hardcoding None) for AgentPool, ManagedClusterAgentPoolProfileProperties, and ManagedClusterAgentPoolProfile, matching the pattern from #9742.

Per Copilot review feedback: add notes near the _validation blocks
referencing the upstream spec PRs so this workaround isn't accidentally
reverted on the next SDK refresh.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants