From d1e1952400242226ee8897dcf74213c624960e0d Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 14:14:14 +0800 Subject: [PATCH 1/5] update nodepool command option names --- src/azure-cli/azure/cli/command_modules/acs/_params.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index f5e8e4b6f94..ab4e36474b5 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -388,10 +388,14 @@ def load_arguments(self, _): c.argument('acr', validator=validate_registry_name) c.argument('node_name') - with self.argument_context('aks nodepool', resource_type=ResourceType.MGMT_CONTAINERSERVICE, operation_group='managed_clusters') as c: + with self.argument_context('aks nodepool', resource_type=ResourceType.MGMT_CONTAINERSERVICE, operation_group='agent_pools') as c: c.argument('cluster_name', help='The cluster name.') - # the following argument is declared for the wait command - c.argument('agent_pool_name', options_list=['--nodepool-name', '--agent-pool-name'], validator=validate_agent_pool_name, help='The node pool name.') + c.argument('nodepool_name', options_list=['--nodepool-name', '--name', '-n'], validator=validate_nodepool_name, help='The node pool name.') + + with self.argument_context('aks nodepool wait', resource_type=ResourceType.MGMT_CONTAINERSERVICE, operation_group='agent_pools') as c: + c.argument('resource_name', options_list=['--cluster-name'], help='The cluster name.') + # the option name '--agent-pool-name' is depracated, left for compatibility only + c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', '--agent-pool-name'], validator=validate_agent_pool_name, help='The node pool name.') for sub_command in ['add', 'update', 'upgrade', 'scale', 'show', 'list', 'delete']: with self.argument_context('aks nodepool ' + sub_command) as c: From 1ac6f6473059d91f81f71507287ccf75b0dda27d Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 14:28:42 +0800 Subject: [PATCH 2/5] fix help --- src/azure-cli/azure/cli/command_modules/acs/_help.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_help.py b/src/azure-cli/azure/cli/command_modules/acs/_help.py index 9e7708c9d0c..a49ee9cbf53 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -1046,10 +1046,6 @@ - name: Get the available upgrade versions for an agent pool of the managed Kubernetes cluster. text: az aks nodepool get-upgrades --resource-group MyResourceGroup --cluster-name MyManagedCluster --nodepool-name MyNodePool crafted: true -parameters: - - name: --nodepool-name - type: string - short-summary: name of the node pool. """ helps['aks nodepool list'] = """ @@ -1145,9 +1141,6 @@ type: command short-summary: Stop running agent pool in the managed Kubernetes cluster. parameters: - - name: --nodepool-name - type: string - short-summary: Agent pool name - name: --aks-custom-headers type: string short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2 @@ -1160,9 +1153,6 @@ type: command short-summary: Start stopped agent pool in the managed Kubernetes cluster. parameters: - - name: --nodepool-name - type: string - short-summary: Agent pool name - name: --aks-custom-headers type: string short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2 @@ -1313,7 +1303,7 @@ examples: - name: Wait for a node pool to reach a desired state, polling every minute for up to thirty minutes. text: |- - az aks nodepool wait --created --interval 60 --name MyManagedCluster --resource-group MyResourceGroup --nodepool-name MyNodePool --timeout 1800 + az aks nodepool wait --created --interval 60 --cluster-name MyManagedCluster --resource-group MyResourceGroup --nodepool-name MyNodePool --timeout 1800 """ helps['aks nodepool snapshot wait'] = """ From 258510a55ec6d6369e7579a010d6238414971702 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 15:13:13 +0800 Subject: [PATCH 3/5] add deprecation info for --agent-pool-name option in aks nodepool wait command --- src/azure-cli/azure/cli/command_modules/acs/_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index ab4e36474b5..df0d6d149bf 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -395,7 +395,7 @@ def load_arguments(self, _): with self.argument_context('aks nodepool wait', resource_type=ResourceType.MGMT_CONTAINERSERVICE, operation_group='agent_pools') as c: c.argument('resource_name', options_list=['--cluster-name'], help='The cluster name.') # the option name '--agent-pool-name' is depracated, left for compatibility only - c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', '--agent-pool-name'], validator=validate_agent_pool_name, help='The node pool name.') + c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', c.deprecate(target='--agent-pool-name', redirect='--nodepool-name')], validator=validate_agent_pool_name, help='The node pool name.') for sub_command in ['add', 'update', 'upgrade', 'scale', 'show', 'list', 'delete']: with self.argument_context('aks nodepool ' + sub_command) as c: From be439f4386da7d3ad6ce3c6b266ee565f87943a8 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 15:20:37 +0800 Subject: [PATCH 4/5] hide by default --- src/azure-cli/azure/cli/command_modules/acs/_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index df0d6d149bf..0fe84258bba 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -395,7 +395,7 @@ def load_arguments(self, _): with self.argument_context('aks nodepool wait', resource_type=ResourceType.MGMT_CONTAINERSERVICE, operation_group='agent_pools') as c: c.argument('resource_name', options_list=['--cluster-name'], help='The cluster name.') # the option name '--agent-pool-name' is depracated, left for compatibility only - c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', c.deprecate(target='--agent-pool-name', redirect='--nodepool-name')], validator=validate_agent_pool_name, help='The node pool name.') + c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', c.deprecate(target='--agent-pool-name', redirect='--nodepool-name', hide=True)], validator=validate_agent_pool_name, help='The node pool name.') for sub_command in ['add', 'update', 'upgrade', 'scale', 'show', 'list', 'delete']: with self.argument_context('aks nodepool ' + sub_command) as c: From aedc7bc6a65a6302793bdd0d8988c1d3106fcce8 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 15:26:31 +0800 Subject: [PATCH 5/5] clean up --- src/azure-cli/azure/cli/command_modules/acs/_params.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index 0fe84258bba..8f722eb4c39 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -397,10 +397,6 @@ def load_arguments(self, _): # the option name '--agent-pool-name' is depracated, left for compatibility only c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', c.deprecate(target='--agent-pool-name', redirect='--nodepool-name', hide=True)], validator=validate_agent_pool_name, help='The node pool name.') - for sub_command in ['add', 'update', 'upgrade', 'scale', 'show', 'list', 'delete']: - with self.argument_context('aks nodepool ' + sub_command) as c: - c.argument('nodepool_name', options_list=['--nodepool-name', '--name', '-n'], validator=validate_nodepool_name, help='The node pool name.') - with self.argument_context('aks nodepool add') as c: c.argument('node_vm_size', options_list=['--node-vm-size', '-s'], completer=get_vm_size_completion_list) c.argument('os_type')