-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support ManagedSystem mode NodePool #8891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
❌Azure CLI Extensions Breaking Change Test
|
|
Hi @hao1939, |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
There was a problem hiding this 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 introduces support for a new ManagedSystem node pool mode that resets all properties except name and mode for both create and update operations. It adds the constant, CLI parameter, help text, decorator logic, and tests to cover the add flow.
- Implemented
set_up_managed_system_modeinagentpool_decorator.pywith early exit inconstruct_agentpool_profile_preview. - Added
ManagedSystemto constants (_consts.py), CLI parameters (_params.py), and help (_help.py). - Added unit tests for the add-decorator behavior in
test_agentpool_decorator.py.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/aks-preview/.../tests/latest/test_agentpool_decorator.py | Added tests for ManagedSystem mode on create and update decorators |
| src/aks-preview/.../agentpool_decorator.py | Implemented set_up_managed_system_mode and early return in preview logic |
| src/aks-preview/.../_params.py | Included ManagedSystem in node_mode_types and related imports |
| src/aks-preview/.../_help.py | Updated help text to explain ManagedSystem behavior |
| src/aks-preview/.../_consts.py | Defined CONST_NODEPOOL_MODE_MANAGEDSYSTEM constant |
Comments suppressed due to low confidence (2)
src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py:1996
- In the update-path test you're instantiating
AKSPreviewAgentPoolAddDecoratorinstead ofAKSPreviewAgentPoolUpdateDecorator. Swap to the update decorator to correctly cover the update flow.
def test_update_to_managed_system_mode(self):
src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py:1391
- [nitpick] Consider adding an end-to-end unit test for
AKSPreviewAgentPoolUpdateDecorator.construct_agentpool_profile_previewwhenmodeisManagedSystemto ensure the update path also resets properties correctly.
def test_construct_agentpool_profile_preview_managed_system(self):
|
Hi @hao1939 Release SuggestionsModule: aks-preview
Notes
|
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py
Show resolved
Hide resolved
|
seems the live test failed with error
|
2828d7e to
0a1025d
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
FumingZhang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a scenario test case for this feature? May check existing examples in test_aks_commands.py
src/aks-preview/azext_aks_preview/tests/latest/demo_enable_managed_system_pool.py
Outdated
Show resolved
Hide resolved
5029a45 to
1e0de7b
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 8891 in repo Azure/azure-cli-extensions |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
| self.__raw_parameters = raw_parameters | ||
| super().__init__(cmd, client, raw_parameters, resource_type) | ||
|
|
||
| def update_managed_system_pools(self, mc: ManagedCluster) -> ManagedCluster: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no corresponding option for command aks update, so this just acts as a guard?
BTW, this made me realize that other client tools probably don’t know that they need to clear other properties when switching nodepool mode to managed system. If the rp validation is strict, this will result in a bad request, resulting in a bad user experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mode is not allowed for updating, so we are not worried CX would change the mode.
For ManagedSystem Pool, because we restrict the api to reject any extra field but not ignore, so we need to clear those properties while reconciling.
| # Check if mode is ManagedSystem, if yes, reset all properties | ||
| agentpool = self.set_up_managed_system_mode(agentpool) | ||
|
|
||
| # If mode is ManagedSystem, skip all other property setups | ||
| if agentpool.mode == CONST_NODEPOOL_MODE_MANAGEDSYSTEM: | ||
| return agentpool | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about putting it to the end of this constructor, then you don't need the check and return early.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quit early could skip unnecessary code branch
| # Check if agentpool is in ManagedSystem mode and handle special case | ||
| if agentpool.mode == CONST_NODEPOOL_MODE_MANAGEDSYSTEM: | ||
| # Make sure all other attributes are None | ||
| for attr in vars(agentpool): | ||
| if attr != 'name' and attr != 'mode' and not attr.startswith('_'): | ||
| if hasattr(agentpool, attr): | ||
| setattr(agentpool, attr, None) | ||
| return agentpool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about wrapping this as a function (maybe add a helper function to do the clean up), and put it to the end of this update function?
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
Live test passed!
|
|
Please add some changelog in the HISTORY.rst file. If you want to release a new version, please update the setup.py file as well. |
|
|
Thanks @yanzhudd! Added, could you help to take a second look? |
src/aks-preview/HISTORY.rst
Outdated
| 18.0.0b18 | ||
| +++++++ | ||
| * Add validation error when neither --location or --cluster and --resource-group-name are specified for az extension type list or az extension type version list | ||
| * Add support for `ManagedSystem` Agent Pool Mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move it to below the Pending part
| 18.0.0b18 | |
| +++++++ | |
| * Add validation error when neither --location or --cluster and --resource-group-name are specified for az extension type list or az extension type version list | |
| * Add support for `ManagedSystem` Agent Pool Mode. | |
| * Add support for `ManagedSystem` Agent Pool Mode. | |
| 18.0.0b18 | |
| +++++++ | |
| * Add validation error when neither --location or --cluster and --resource-group-name are specified for az extension type list or az extension type version list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As yan suggested, please move your release note to the pending section if you don't want to release a new version immediately. Otherwise, please add a new section with version number 18.0.0b19 and update setup.py accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, updated.
e9c30b6 to
908b1d8
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
ManagedSystem Pool Support.
This feature introduces support for ManagedSystem node pools, enabling users to:
aks create --resource-group={resource_group} --name={name} --enable-managed-system-poolaks nodepool add --resource-group={resource_group} --cluster-name={name} --name={nodepool_name} --mode ManagedSystemaks nodepool delete --resource-group={resource_group} --cluster-name={name} --name={nodepool_name}aks nodepool update --resource-group={resource_group} --cluster-name={name} --name={nodepool_name}This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks create -g MyResourceGroup -n MyManagedCluster --managed-system-pool
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)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.