Skip to content

Commit

Permalink
if image is hosted on acr, and no registry server is supplied, infer …
Browse files Browse the repository at this point in the history
…the registry server
  • Loading branch information
calvinsID committed Mar 10, 2022
1 parent 967f4e4 commit bf8bc02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ def create_containerapp(cmd,
if secrets is not None:
secrets_def = parse_secret_flags(secrets)

# If ACR image and registry_server is not supplied, infer it
if image and '.azurecr.io' in image:
if not registry_server:
registry_server = image.split('/')[0]

registries_def = None
if registry_server is not None:
registries_def = RegistryCredentialsModel
Expand Down Expand Up @@ -496,6 +501,11 @@ def update_containerapp(cmd,
if not containerapp_def:
raise CLIError("The containerapp '{}' does not exist".format(name))

# If ACR image and registry_server is not supplied, infer it
if image and '.azurecr.io' in image:
if not registry_server:
registry_server = image.split('/')[0]

update_map = {}
update_map['secrets'] = secrets is not None
update_map['ingress'] = ingress or target_port or transport or traffic_weights
Expand Down

0 comments on commit bf8bc02

Please sign in to comment.