Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# --------------------------------------------------------------------------------------------

# pylint: disable=wrong-import-order
from .vendored_sdks.appplatform.v2022_01_01_preview import models
from .vendored_sdks.appplatform.v2022_03_01_preview import models
from azure.cli.core.azclierror import (ArgumentUsageError)
from ._utils import convert_argument_to_parameter_list

import shlex


class BaseSource:
def fulfilled_options_from_original_source_info(self, **_):
Expand Down Expand Up @@ -105,6 +107,10 @@ def _format_container(self, container_registry=None, container_image=None,
container_command, container_args,
registry_username, registry_password]):
return None
if container_command is not None:
container_command = shlex.split(container_command)
if container_args is not None:
container_args = shlex.split(container_args)
credential = models.ImageRegistryCredential(
username=registry_username,
password=registry_password # [SuppressMessage("Microsoft.Security", "CS001:SecretInline", Justification="false positive")]
Expand Down
4 changes: 2 additions & 2 deletions src/spring-cloud/azext_spring_cloud/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ def prepare_logs_argument(c):
c.argument(
'registry_password', help='The password of the container registry.', arg_group='Custom Container')
c.argument(
'container_command', help='The command of the container image.', nargs='*', arg_group='Custom Container')
'container_command', help='The command of the container image.', arg_group='Custom Container')
c.argument(
'container_args', help='The arguments of the container image.', nargs='*', arg_group='Custom Container')
'container_args', help='The arguments of the container image.', arg_group='Custom Container')
Comment on lines -367 to +369
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to ask whether the change will cause breaking change to users?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Actually the correct type is string. It's changed to the array accidentally in a previous refactoring.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

c.argument(
'build_env', build_env_type)

Expand Down
4 changes: 4 additions & 0 deletions src/spring/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Release History
===============
1.1.2
---
* Fix the arguments parsing of the Command `az spring app create` with "--container-image".

1.1.1
---
* Support configure OpenAPI URI in Spring Cloud Gateway route configs.
Expand Down
8 changes: 7 additions & 1 deletion src/spring/azext_spring/_deployment_source_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# --------------------------------------------------------------------------------------------

# pylint: disable=wrong-import-order
from .vendored_sdks.appplatform.v2022_01_01_preview import models
from .vendored_sdks.appplatform.v2022_03_01_preview import models
from azure.cli.core.azclierror import (ArgumentUsageError)
from ._utils import convert_argument_to_parameter_list

import shlex


class BaseSource:
def fulfilled_options_from_original_source_info(self, **_):
Expand Down Expand Up @@ -105,6 +107,10 @@ def _format_container(self, container_registry=None, container_image=None,
container_command, container_args,
registry_username, registry_password]):
return None
if container_command is not None:
container_command = shlex.split(container_command)
if container_args is not None:
container_args = shlex.split(container_args)
credential = models.ImageRegistryCredential(
username=registry_username,
password=registry_password # [SuppressMessage("Microsoft.Security", "CS001:SecretInline", Justification="false positive")]
Expand Down
4 changes: 2 additions & 2 deletions src/spring/azext_spring/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ def prepare_logs_argument(c):
c.argument(
'registry_password', help='The password of the container registry.', arg_group='Custom Container')
c.argument(
'container_command', help='The command of the container image.', nargs='*', arg_group='Custom Container')
'container_command', help='The command of the container image.', arg_group='Custom Container')
c.argument(
'container_args', help='The arguments of the container image.', nargs='*', arg_group='Custom Container')
'container_args', help='The arguments of the container image.', arg_group='Custom Container')
c.argument(
'build_env', build_env_type)
c.argument(
Expand Down
Loading