diff --git a/src/containerapp/azext_containerapp/_params.py b/src/containerapp/azext_containerapp/_params.py index 52ec7310492..c70de7f12ac 100644 --- a/src/containerapp/azext_containerapp/_params.py +++ b/src/containerapp/azext_containerapp/_params.py @@ -163,7 +163,7 @@ def load_arguments(self, _): with self.argument_context('containerapp env dapr-component') as c: c.argument('dapr_app_id', help="The Dapr app ID.") c.argument('dapr_app_port', help="The port of your app.") - c.argument('dapr_app_protocol', help="Tells Dapr which protocol your application is using. Allowed values: grpc, http.") + c.argument('dapr_app_protocol', help="Tell Dapr which protocol your application is using. Allowed values: grpc, http.") c.argument('dapr_component_name', help="The Dapr component name.") c.argument('environment_name', options_list=['--name', '-n'], help="The environment name.") diff --git a/src/containerapp/azext_containerapp/commands.py b/src/containerapp/azext_containerapp/commands.py index bdc2b14cb1b..97da07cefc0 100644 --- a/src/containerapp/azext_containerapp/commands.py +++ b/src/containerapp/azext_containerapp/commands.py @@ -43,7 +43,7 @@ def transform_revision_list_output(revs): def load_command_table(self, _): - with self.command_group('containerapp') as g: + with self.command_group('containerapp', is_preview=True) as g: g.custom_show_command('show', 'show_containerapp', table_transformer=transform_containerapp_output) g.custom_command('list', 'list_containerapp', table_transformer=transform_containerapp_list_output) g.custom_command('create', 'create_containerapp', supports_no_wait=True, exception_handler=ex_handler_factory()) diff --git a/src/containerapp/azext_containerapp/custom.py b/src/containerapp/azext_containerapp/custom.py index 11840025404..633e50544c9 100644 --- a/src/containerapp/azext_containerapp/custom.py +++ b/src/containerapp/azext_containerapp/custom.py @@ -21,7 +21,7 @@ from ._client_factory import handle_raw_exception from ._clients import ManagedEnvironmentClient, ContainerAppClient, GitHubActionClient, DaprComponentClient -# from ._sdk_models import * # pylint: disable=wildcard-import, unused-wildcard-import +from ._sdk_models import * # pylint: disable=wildcard-import, unused-wildcard-import from ._github_oauth import get_github_access_token from ._models import ( ManagedEnvironment as ManagedEnvironmentModel, @@ -455,16 +455,12 @@ def update_containerapp(cmd, min_replicas=None, max_replicas=None, revisions_mode=None, - secrets=None, set_env_vars=None, remove_env_vars=None, replace_env_vars=None, remove_all_env_vars=False, cpu=None, memory=None, - registry_server=None, - registry_user=None, - registry_pass=None, revision_suffix=None, startup_command=None, args=None, @@ -474,8 +470,7 @@ def update_containerapp(cmd, if yaml: if image or min_replicas or max_replicas or\ - revisions_mode or secrets or set_env_vars or remove_env_vars or replace_env_vars or remove_all_env_vars or cpu or memory or registry_server or\ - registry_user or registry_pass or\ + revisions_mode or set_env_vars or remove_env_vars or replace_env_vars or remove_all_env_vars or cpu or memory or\ startup_command or args or tags: logger.warning('Additional flags were passed along with --yaml. These flags will be ignored, and the configuration defined in the yaml will be used instead') return update_containerapp_yaml(cmd=cmd, name=name, resource_group_name=resource_group_name, file_name=yaml, no_wait=no_wait) @@ -498,11 +493,9 @@ def update_containerapp(cmd, e["value"] = "" update_map = {} - update_map['secrets'] = secrets is not None - update_map['registries'] = registry_server or registry_user or registry_pass update_map['scale'] = min_replicas or max_replicas update_map['container'] = image or container_name or set_env_vars is not None or remove_env_vars is not None or replace_env_vars is not None or remove_all_env_vars or cpu or memory or startup_command is not None or args is not None - update_map['configuration'] = update_map['secrets'] or update_map['registries'] or revisions_mode is not None + update_map['configuration'] = revisions_mode is not None if tags: _add_or_update_tags(containerapp_def, tags) @@ -631,57 +624,6 @@ def update_containerapp(cmd, _get_existing_secrets(cmd, resource_group_name, name, containerapp_def) - if secrets is not None: - _add_or_update_secrets(containerapp_def, parse_secret_flags(secrets)) - - if update_map["registries"]: - registries_def = None - registry = None - - if "registries" not in containerapp_def["properties"]["configuration"]: - containerapp_def["properties"]["configuration"]["registries"] = [] - - registries_def = containerapp_def["properties"]["configuration"]["registries"] - - if not registry_server: - raise ValidationError("Usage error: --registry-server is required when adding or updating a registry") - - # Infer credentials if not supplied and its azurecr - if (registry_user is None or registry_pass is None) and not _registry_exists(containerapp_def, registry_server): - registry_user, registry_pass = _infer_acr_credentials(cmd, registry_server) - - # Check if updating existing registry - updating_existing_registry = False - for r in registries_def: - if r['server'].lower() == registry_server.lower(): - updating_existing_registry = True - - if registry_user: - r["username"] = registry_user - if registry_pass: - r["passwordSecretRef"] = store_as_secret_and_return_secret_ref( - containerapp_def["properties"]["configuration"]["secrets"], - r["username"], - r["server"], - registry_pass, - update_existing_secret=True) - - # If not updating existing registry, add as new registry - if not updating_existing_registry: - if not(registry_server is not None and registry_user is not None and registry_pass is not None): - raise ValidationError("Usage error: --registry-server, --registry-password and --registry-username are required when adding a registry") - - registry = RegistryCredentialsModel - registry["server"] = registry_server - registry["username"] = registry_user - registry["passwordSecretRef"] = store_as_secret_and_return_secret_ref( - containerapp_def["properties"]["configuration"]["secrets"], - registry_user, - registry_server, - registry_pass, - update_existing_secret=True) - - registries_def.append(registry) try: r = ContainerAppClient.create_or_update( cmd=cmd, resource_group_name=resource_group_name, name=name, container_app_envelope=containerapp_def, no_wait=no_wait) diff --git a/src/containerapp/setup.py b/src/containerapp/setup.py index be4cd26f637..e23b0011367 100644 --- a/src/containerapp/setup.py +++ b/src/containerapp/setup.py @@ -29,6 +29,8 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'License :: OSI Approved :: MIT License', ]