-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[AKS] az aks nodepool delete-machines
: Add support to delete specific machines in an agent pool
#29921
Conversation
️✔️AzureCLI-FullTest
|
Hi @xuexu6666, |
|
rule | cmd_name | rule_message | suggest_message |
---|---|---|---|
aks nodepool delete-machines | cmd aks nodepool delete-machines added |
AKS |
az aks nodepool delete-machines
def aks_machine_list_table_format(results): | ||
return [aks_machine_show_table_format(r) for r in results] | ||
|
||
def aks_machine_show_table_format(result): |
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.
Can you add some unit tests for this?
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.
I finally decide to use kubectl to get machine name instead of use machine api. Machine api is not GA yet.
@AKSCustomResourceGroupPreparer( | ||
random_name_length=17, name_prefix="clitest", location="westus2" | ||
) | ||
def test_aks_nodepool_delete_machines(self, resource_group, resource_group_location): |
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.
Queued live test for this, you'll need to commit the recording file (would be generated by running the test case in live mode, find it from pipeline artifact) to pass CI.
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.
https://dev.azure.com/msazure/CloudNativeCompute/_build/results?buildId=103633419&view=results
This is the passed test I ran. Wondering which recording file do I need? btw, I uploaded the test_aks_nodepool_delete_machines.yaml already.
![image](https://private-user-images.githubusercontent.com/55420084/369115854-deba74cb-606d-48b2-ab1e-c3aacae2041b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzQ1NzIxMjUsIm5iZiI6MTczNDU3MTgyNSwicGF0aCI6Ii81NTQyMDA4NC8zNjkxMTU4NTQtZGViYTc0Y2ItNjA2ZC00OGIyLWFiMWUtYzNhYWNhZTIwNDFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMjE5VDAxMzAyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZhNTE2MTk0N2MyOTZmY2E3NGI1M2E4OTU0Y2Q3MWM1YmJkMGM3MDVkMzRkMjE5M2RmNGU0MWVjNWJhOTc2YzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fbxtR_5y4B6IQ6XQyod0fEralqmx2jOPI8JEj6dtfiA)
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.
Take another look, it seems that you performed some data plane operations in the test case, which cannot be properly replayed. Please mark the case as @live_only()
(and left a comment, remove the corresponding recording file) to bypass the check.
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.
done
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 fix failed CI checks
/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/_params.py:924:1: E302 expected 2 blank lines, found 1
/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/custom.py:2651:1: E302 expected 2 blank lines, found 1
@@ -134,6 +134,7 @@ def load_command_table(self, _): | |||
g.custom_command('start', 'aks_agentpool_start', supports_no_wait=True) | |||
g.wait_command('wait') | |||
g.custom_command('operation-abort', 'aks_agentpool_operation_abort', supports_no_wait=True) | |||
g.custom_command("delete-machines", "aks_agentpool_delete_machines", supports_no_wait=True) |
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.
- FAIL - HIGH severity: missing_command_test_coverage
Repo: ./, Src Branch: HEAD, Target Branch: origin/dev - Failed.
Missing command test coverage:aks nodepool "delete-machines"
Please add some scenario tests for the new command
Or add the command with missing_command_test_coverage rule in linter_exclusions.yml
Rules in CI might be a bit rigid, I guess changing "delete-machines"
to 'delete-machines'
would fix the issue.
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.
done
@AKSCustomResourceGroupPreparer( | ||
random_name_length=17, name_prefix="clitest", location="westus2" | ||
) | ||
def test_aks_nodepool_delete_machines(self, resource_group, resource_group_location): |
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.
Take another look, it seems that you performed some data plane operations in the test case, which cannot be properly replayed. Please mark the case as @live_only()
(and left a comment, remove the corresponding recording file) to bypass the check.
It is recommended to modify the PR title to
|
az aks nodepool delete-machines
az aks nodepool delete-machines
: Add support to delete specific machines in an agent pool
Related command
az aks nodepool delete-machines
delete machines API was added to 2024-07-01
Description
We want to add the new feature delete-machines in GA cli.
Testing Guide
Use the command
az aks nodepool delete-machines
to send the request to aks. Use the commandaz aks machine list
to verify the results.This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.