From d3e7d2e8ee7ed769209fa394479952d378355b60 Mon Sep 17 00:00:00 2001 From: Calvin Chan Date: Mon, 21 Mar 2022 11:42:48 -0700 Subject: [PATCH] Fix linter issues --- src/containerapp/azext_containerapp/_help.py | 24 +++++-------------- .../azext_containerapp/_params.py | 7 ++++-- .../azext_containerapp/commands.py | 1 - 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/containerapp/azext_containerapp/_help.py b/src/containerapp/azext_containerapp/_help.py index a306f2f6bd7..2c6a5009069 100644 --- a/src/containerapp/azext_containerapp/_help.py +++ b/src/containerapp/azext_containerapp/_help.py @@ -64,14 +64,6 @@ text: az containerapp delete -g MyResourceGroup -n MyContainerapp """ -helps['containerapp scale'] = """ - type: command - short-summary: Set the min and max replicas for a container app (latest revision in multiple revisions mode). - examples: - - name: Scale a container's latest revision. - text: az containerapp scale -g MyResourceGroup -n MyContainerapp --min-replicas 1 --max-replicas 2 -""" - helps['containerapp show'] = """ type: command short-summary: Show details of a container app. @@ -106,7 +98,7 @@ - name: Show details of a revision. text: | az containerapp revision show -n MyContainerapp -g MyResourceGroup \\ - --revision-name MyContainerappRevision + --revision MyContainerappRevision """ helps['containerapp revision list'] = """ @@ -200,10 +192,6 @@ --location "Canada Central" """ -helps['containerapp env update'] = """ - type: command - short-summary: Update a Container Apps environment. Currently Unsupported. -""" helps['containerapp env delete'] = """ type: command @@ -245,7 +233,7 @@ examples: - name: List dapr components for a Containerapp environment. text: | - az containerapp env dapr-component list -g MyResourceGroup --environment-name MyEnvironment + az containerapp env dapr-component list -g MyResourceGroup --name MyEnvironment """ helps['containerapp env dapr-component show'] = """ @@ -254,7 +242,7 @@ examples: - name: Show the details of a dapr component. text: | - az containerapp env dapr-component show -g MyResourceGroup --dapr-component-name MyDaprComponenetName --environment-name MyEnvironment + az containerapp env dapr-component show -g MyResourceGroup --dapr-component-name MyDaprComponentName --name MyEnvironment """ helps['containerapp env dapr-component set'] = """ @@ -263,7 +251,7 @@ examples: - name: Create a dapr component. text: | - az containerapp env dapr-component set -g MyResourceGroup --environment-name MyEnv --yaml MyYAMLPath --name MyDaprName + az containerapp env dapr-component set -g MyResourceGroup --name MyEnv --yaml MyYAMLPath --dapr-component-name MyDaprComponentName """ helps['containerapp env dapr-component remove'] = """ @@ -272,7 +260,7 @@ examples: - name: Remove a dapr componenet from a Containerapp environment. text: | - az containerapp env dapr-component remove -g MyResourceGroup --dapr-component-name MyDaprComponenetName --environment-name MyEnvironment + az containerapp env dapr-component remove -g MyResourceGroup --dapr-component-name MyDaprComponenetName --name MyEnvironment """ # Identity Commands @@ -303,7 +291,7 @@ examples: - name: Remove system identity. text: | - az containerapp identity remove [system] + az containerapp identity remove --identities [system] - name: Remove system and user identity. text: | az containerapp identity remove --identities [system] myAssignedId diff --git a/src/containerapp/azext_containerapp/_params.py b/src/containerapp/azext_containerapp/_params.py index 96ec69e5d8b..e2006b28187 100644 --- a/src/containerapp/azext_containerapp/_params.py +++ b/src/containerapp/azext_containerapp/_params.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long, too-many-statements, consider-using-f-string +# pylint: disable=line-too-long, too-many-statements, consider-using-f-string, option-length-too-long from knack.arguments import CLIArgumentType @@ -55,7 +55,7 @@ def load_arguments(self, _): # Dapr with self.argument_context('containerapp', arg_group='Dapr') as c: - c.argument('dapr_enabled', options_list=['--enable-dapr'], default=False, arg_type=get_three_state_flag()) + c.argument('dapr_enabled', options_list=['--enable-dapr'], default=False, arg_type=get_three_state_flag(), help="Boolean indicating if the Dapr side car is enabled.") c.argument('dapr_app_port', type=int, help="The port Dapr uses to talk to the application.") c.argument('dapr_app_id', type=str, help="The Dapr application identifier.") c.argument('dapr_app_protocol', type=str, arg_type=get_enum_type(['http', 'grpc']), help="The protocol Dapr uses to talk to the application.") @@ -155,6 +155,9 @@ def load_arguments(self, _): with self.argument_context('containerapp secret set') as c: c.argument('secrets', nargs='+', options_list=['--secrets', '-s'], help="A list of secret(s) for the container app. Space-separated values in 'key=value' format.") + with self.argument_context('containerapp secret show') as c: + c.argument('secret_name', help="The name of the secret to show.") + with self.argument_context('containerapp secret remove') as c: c.argument('secret_names', nargs='+', help="A list of secret(s) for the container app. Space-separated secret values names.") diff --git a/src/containerapp/azext_containerapp/commands.py b/src/containerapp/azext_containerapp/commands.py index 87a892201a8..f2f67098d34 100644 --- a/src/containerapp/azext_containerapp/commands.py +++ b/src/containerapp/azext_containerapp/commands.py @@ -54,7 +54,6 @@ def load_command_table(self, _): g.custom_command('show', 'show_managed_environment') g.custom_command('list', 'list_managed_environments') g.custom_command('create', 'create_managed_environment', supports_no_wait=True, exception_handler=ex_handler_factory()) - # g.custom_command('update', 'update_managed_environment', supports_no_wait=True, exception_handler=ex_handler_factory()) g.custom_command('delete', 'delete_managed_environment', supports_no_wait=True, confirmation=True, exception_handler=ex_handler_factory()) with self.command_group('containerapp env dapr-component') as g: