Skip to content

Commit 5192188

Browse files
authored
[Container app] az containerapp job start Ensure that args/cmd arguments are passed even without image argument (#32743)
1 parent ca34d69 commit 5192188

File tree

3 files changed

+20578
-2
lines changed

3 files changed

+20578
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,12 @@ def start_containerappsjob(cmd,
15551555

15561556
template_def = None
15571557

1558-
if image is not None:
1558+
# Check if any container override parameters are provided
1559+
has_container_overrides = (image is not None or container_name is not None or
1560+
env_vars is not None or startup_command is not None or
1561+
args is not None or cpu is not None or memory is not None)
1562+
1563+
if has_container_overrides:
15591564
template_def = JobExecutionTemplateModel
15601565
container_def = ContainerModel
15611566
resources_def = None
@@ -1565,7 +1570,11 @@ def start_containerappsjob(cmd,
15651570
resources_def["memory"] = memory
15661571

15671572
container_def["name"] = container_name if container_name else name
1568-
container_def["image"] = image if not is_registry_msi_system(registry_identity) else HELLO_WORLD_IMAGE
1573+
1574+
# If no image is provided, fetch the existing job's image
1575+
if image is not None:
1576+
container_def["image"] = image if not is_registry_msi_system(registry_identity) else HELLO_WORLD_IMAGE
1577+
15691578
if env_vars is not None:
15701579
container_def["env"] = parse_env_var_flags(env_vars)
15711580
if startup_command is not None:

0 commit comments

Comments
 (0)