Skip to content

Commit 26baeb4

Browse files
committed
Don't fetch image if it's not provided - let RP handle this case
1 parent 54e6fca commit 26baeb4

File tree

2 files changed

+16476
-132
lines changed

2 files changed

+16476
-132
lines changed

src/azure-cli/azure/cli/command_modules/containerapp/custom.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,20 +1574,6 @@ def start_containerappsjob(cmd,
15741574
# If no image is provided, fetch the existing job's image
15751575
if image is not None:
15761576
container_def["image"] = image if not is_registry_msi_system(registry_identity) else HELLO_WORLD_IMAGE
1577-
else:
1578-
# Fetch the existing job definition to get the default image
1579-
try:
1580-
containerappjob_def = ContainerAppsJobClient.show(cmd=cmd, resource_group_name=resource_group_name, name=name)
1581-
except Exception as e:
1582-
handle_raw_exception(e)
1583-
1584-
if not containerappjob_def:
1585-
raise ResourceNotFoundError("The containerapp job '{}' does not exist".format(name))
1586-
1587-
existing_image = safe_get(containerappjob_def, "properties", "template", "containers", default=[{}])[0].get("image")
1588-
if not existing_image:
1589-
raise ValidationError("Could not find an existing image for the containerapp job '{}'. Please specify --image.".format(name))
1590-
container_def["image"] = existing_image if not is_registry_msi_system(registry_identity) else HELLO_WORLD_IMAGE
15911577

15921578
if env_vars is not None:
15931579
container_def["env"] = parse_env_var_flags(env_vars)

0 commit comments

Comments
 (0)