Skip to content

Commit

Permalink
prevent using --only-show-errors, --output, -o in up
Browse files Browse the repository at this point in the history
  • Loading branch information
StrawnSC committed May 3, 2022
1 parent 6b3468a commit 53ddc45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/containerapp/azext_containerapp/_up_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,13 @@ def _get_ingress_and_target_port(ingress, target_port, dockerfile_content: "list
return ingress, target_port


def _validate_up_args(source, image, repo, registry_server):
def _validate_up_args(cmd, source, image, repo, registry_server):
disallowed_params = ["--only-show-errors", "--output", "-o"]
command_args = cmd.cli_ctx.data.get("safe_params", [])
for a in disallowed_params:
if a in command_args:
raise ValidationError(f"Argument {a} is not allowed for 'az containerapp up'")

if not source and not image and not repo:
raise RequiredArgumentMissingError(
"You must specify either --source, --repo, or --image"
Expand Down
2 changes: 1 addition & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ def containerapp_up(cmd,
HELLOWORLD = "mcr.microsoft.com/azuredocs/containerapps-helloworld"
dockerfile = "Dockerfile" # for now the dockerfile name must be "Dockerfile" (until GH actions API is updated)

_validate_up_args(source, image, repo, registry_server)
_validate_up_args(cmd, source, image, repo, registry_server)
validate_container_app_name(name)
check_env_name_on_rg(cmd, managed_env, resource_group_name, location)

Expand Down

0 comments on commit 53ddc45

Please sign in to comment.