Skip to content

[AKS] Allow updating primary agent pool name for load balancer config#9822

Open
Liunardy wants to merge 1 commit intoAzure:mainfrom
Liunardy:aks-lb-update-primary-agent-pool
Open

[AKS] Allow updating primary agent pool name for load balancer config#9822
Liunardy wants to merge 1 commit intoAzure:mainfrom
Liunardy:aks-lb-update-primary-agent-pool

Conversation

@Liunardy
Copy link
Copy Markdown


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

Related command

az aks loadbalancer update

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 April 23, 2026 04:55
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Apr 23, 2026

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 23, 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

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

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

Enables az aks loadbalancer update to change the --primary-agent-pool-name for an existing load balancer configuration (previously rejected), and bumps the aks-preview extension version to publish the feature.

Changes:

  • Allow primary_agent_pool_name changes in aks_loadbalancer_update_internal by treating it as an updatable field (instead of throwing BadRequestError).
  • Add unit + scenario test coverage validating primary agent pool updates and “no changes requested” behavior.
  • Bump extension version to 20.0.0b4 and document the change in HISTORY.rst.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/aks-preview/azext_aks_preview/loadbalancerconfiguration.py Removes the hard-block on changing primary_agent_pool_name and counts it as a valid update.
src/aks-preview/azext_aks_preview/tests/latest/test_loadbalancer_configuration.py Adds unit tests covering primary agent pool updates + no-op update rejection.
src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Extends the scenario test to validate updating primaryAgentPoolName end-to-end.
src/aks-preview/setup.py Version bump to 20.0.0b4.
src/aks-preview/HISTORY.rst Changelog entry for the new behavior and the release section for 20.0.0b4.

@github-actions
Copy link
Copy Markdown
Contributor

nilo19
nilo19 previously approved these changes Apr 23, 2026
@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Copy Markdown
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

lgtm

Queued live test to validate the change.

@FumingZhang
Copy link
Copy Markdown
Member

lgtm

Queued live test to validate the change.

Test failed with error

          raise AzureInternalError(
                f"Timed out waiting for load balancers to reach 'Succeeded' state. "
                f"Operation took longer than {timeout_seconds} seconds."
            )

E azure.cli.core.azclierror.AzureInternalError: Timed out waiting for load balancers to reach 'Succeeded' state. Operation took longer than 600 seconds.

azure-cli-extensions/src/aks-preview/azext_aks_preview/loadbalancerconfiguration.py:344: AzureInternalError

https://dev.azure.com/msazure/CloudNativeCompute/CloudNativeCompute%20Team/_build/results?buildId=161615589&view=logs&j=b162b355-d59d-5864-ce0f-0a70f12dd28b&t=a26fe913-e2be-5062-b08e-d15f1acc7ea2&l=4335

Please also resolve merge conflict, cc @Liunardy

@Liunardy Liunardy force-pushed the aks-lb-update-primary-agent-pool branch from d05819a to bfba063 Compare April 24, 2026 08:13
@Liunardy
Copy link
Copy Markdown
Author

lgtm
Queued live test to validate the change.

Test failed with error

          raise AzureInternalError(
                f"Timed out waiting for load balancers to reach 'Succeeded' state. "
                f"Operation took longer than {timeout_seconds} seconds."
            )

E azure.cli.core.azclierror.AzureInternalError: Timed out waiting for load balancers to reach 'Succeeded' state. Operation took longer than 600 seconds.
azure-cli-extensions/src/aks-preview/azext_aks_preview/loadbalancerconfiguration.py:344: AzureInternalError

https://dev.azure.com/msazure/CloudNativeCompute/CloudNativeCompute%20Team/_build/results?buildId=161615589&view=logs&j=b162b355-d59d-5864-ce0f-0a70f12dd28b&t=a26fe913-e2be-5062-b08e-d15f1acc7ea2&l=4335

Please also resolve merge conflict, cc @Liunardy

Rebased and resolved merge conflict.
It failed at "Update the secondary LoadBalance with selectors" which is before the step that test the new change in this PR (update primary agent pool). I tested live again locally and there is no failure. cc @FumingZhang

@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

Re-queued live test

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