Skip to content

Conversation

@wenxuan0923
Copy link
Contributor

…sters that have hosted system components enabled.
Automatic cluster with hosted system components enabled may have empty agentpool profiles. Fix the related code for update/upgrade operations.

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? (pip install wheel==0.30.0 required)
  • 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.

Copilot AI review requested due to automatic review settings November 4, 2025 02:39
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Nov 4, 2025

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

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 4, 2025

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

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

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>

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Copy link
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

This PR fixes a NoneType error that occurs when performing operations on automatic AKS clusters with hosted system components enabled. These clusters may not have agent pool profiles, so the code needs to handle None or empty agent_pool_profiles gracefully.

Key changes:

  • Added defensive checks for empty/None agent_pool_profiles across multiple functions
  • Moved validation logic to execute only when operations actually require agent pool profiles
  • Added a new update_agentpool_profile method with special handling for automatic clusters

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
setup.py Bumped version to 19.0.0b10
HISTORY.rst Added release notes for version 19.0.0b10
managed_cluster_decorator.py Added update_agentpool_profile method and moved validation checks to be conditional
custom.py Added defensive checks and guards for empty agent_pool_profiles in multiple functions
Comments suppressed due to low confidence (1)

src/aks-preview/azext_aks_preview/custom.py:1575

  • The len() call will fail with a TypeError if instance.agent_pool_profiles is None. This check should use (instance.agent_pool_profiles or []) like the iteration on line 1581, or validate that agent_pool_profiles is not None before calling len().
    if len(instance.agent_pool_profiles) > 1 and nodepool_name == "":

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Nov 4, 2025
@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Nov 4, 2025
FumingZhang
FumingZhang previously approved these changes Nov 4, 2025
@zhoxing-ms
Copy link
Contributor

Could you add some test cases for this PR change?

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

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

@wenxuan0923
Copy link
Contributor Author

@zhoxing-ms yes I have added unit tests for the change, thank you!

@zhoxing-ms zhoxing-ms merged commit aad8ba5 into Azure:main Nov 10, 2025
25 checks passed
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ aks-preview-19.0.0b15 ] : https://dev.azure.com/msazure/One/_build/results?buildId=143195860&view=results

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.

5 participants