From f7df43a8aa2ec22d05addfa37a7d35300e2b200a Mon Sep 17 00:00:00 2001 From: Yitong Feng Date: Thu, 18 Jan 2024 13:31:33 +0800 Subject: [PATCH 1/2] {AKS} remove TA command --source-resource-id parameter alias -r --- src/azure-cli/azure/cli/command_modules/acs/_help.py | 2 +- src/azure-cli/azure/cli/command_modules/acs/_params.py | 2 +- ...test_aks_create_with_trustedaccess_rolebinding.yaml | 10 +++++----- .../acs/tests/latest/test_aks_commands.py | 2 +- 4 files changed, 8 insertions(+), 8 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 3968ac8264a..6d81abc4622 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -2072,7 +2072,7 @@ - name: --roles type: string short-summary: Specify the comma-separated roles. - - name: --source-resource-id -r + - name: --source-resource-id type: string short-summary: Specify the source resource id of the binding. 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 fbb4482b740..b16d632dcc9 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -664,7 +664,7 @@ def load_arguments(self, _): with self.argument_context('aks trustedaccess rolebinding create') as c: c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...') - c.argument('source_resource_id', options_list=['--source-resource-id', '-r'], help='The source resource id of the binding') + c.argument('source_resource_id', options_list=['--source-resource-id'], help='The source resource id of the binding') with self.argument_context('aks trustedaccess rolebinding update') as c: c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...') diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_with_trustedaccess_rolebinding.yaml b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_with_trustedaccess_rolebinding.yaml index 6af2cd452c4..0f9dbe4719f 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_with_trustedaccess_rolebinding.yaml +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_with_trustedaccess_rolebinding.yaml @@ -703,7 +703,7 @@ interactions: Connection: - keep-alive ParameterSetName: - - --resource-group --cluster-name -n -r --roles + - --resource-group --cluster-name -n --source-resource-id --roles User-Agent: - AZURECLI/2.56.0 azsdk-python-azure-mgmt-containerservice/28.0.0 Python/3.8.10 (Linux-6.2.0-1018-azure-x86_64-with-glibc2.29) @@ -754,7 +754,7 @@ interactions: Content-Type: - application/json ParameterSetName: - - --resource-group --cluster-name -n -r --roles + - --resource-group --cluster-name -n --source-resource-id --roles User-Agent: - AZURECLI/2.56.0 azsdk-python-azure-mgmt-containerservice/28.0.0 Python/3.8.10 (Linux-6.2.0-1018-azure-x86_64-with-glibc2.29) @@ -804,7 +804,7 @@ interactions: Connection: - keep-alive ParameterSetName: - - --resource-group --cluster-name -n -r --roles + - --resource-group --cluster-name -n --source-resource-id --roles User-Agent: - AZURECLI/2.56.0 azsdk-python-azure-mgmt-containerservice/28.0.0 Python/3.8.10 (Linux-6.2.0-1018-azure-x86_64-with-glibc2.29) @@ -851,7 +851,7 @@ interactions: Connection: - keep-alive ParameterSetName: - - --resource-group --cluster-name -n -r --roles + - --resource-group --cluster-name -n --source-resource-id --roles User-Agent: - AZURECLI/2.56.0 azsdk-python-azure-mgmt-containerservice/28.0.0 Python/3.8.10 (Linux-6.2.0-1018-azure-x86_64-with-glibc2.29) @@ -899,7 +899,7 @@ interactions: Connection: - keep-alive ParameterSetName: - - --resource-group --cluster-name -n -r --roles + - --resource-group --cluster-name -n --source-resource-id --roles User-Agent: - AZURECLI/2.56.0 azsdk-python-azure-mgmt-containerservice/28.0.0 Python/3.8.10 (Linux-6.2.0-1018-azure-x86_64-with-glibc2.29) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py index 8734d81a760..abe2380d90b 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py @@ -9746,7 +9746,7 @@ def test_aks_create_with_trustedaccess_rolebinding(self, resource_group, resourc '--resource-group={resource_group} ' \ '--cluster-name={name} ' \ '-n testbinding ' \ - '-r {sid} ' \ + '--source-resource-id {sid} ' \ '--roles Microsoft.MachineLearningServices/workspaces/mlworkload' self.cmd(create_binding_cmd) self.cmd(list_binding_cmd, checks=[ From 253888412b5028a56eaf2d60fe7844454c3844cd Mon Sep 17 00:00:00 2001 From: Yitong Feng Date: Thu, 18 Jan 2024 17:57:12 +0800 Subject: [PATCH 2/2] deprecate --- src/azure-cli/azure/cli/command_modules/acs/_params.py | 9 ++++++++- 1 file changed, 8 insertions(+), 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 b16d632dcc9..d83a2bb0b26 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -664,7 +664,14 @@ def load_arguments(self, _): with self.argument_context('aks trustedaccess rolebinding create') as c: c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...') - c.argument('source_resource_id', options_list=['--source-resource-id'], help='The source resource id of the binding') + c.argument( + 'source_resource_id', + options_list=[ + '--source-resource-id', + c.deprecate(target='-r', redirect='--source-resource-id', hide=True), + ], + help='The source resource id of the binding', + ) with self.argument_context('aks trustedaccess rolebinding update') as c: c.argument('roles', help='comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...')