Skip to content

Commit fc72229

Browse files
committed
fix: double start
1 parent 225f21d commit fc72229

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

subcommands/up.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,19 @@ def compose_up(
339339
if existing_hash != new_hash:
340340
changed_services.append(svc)
341341

342+
# When the pod is being (re)started it auto-starts its containers.
343+
# Exclude container services to avoid double-starting them.
344+
pod_svc: str | None = None
345+
container_svcs: set[str] = set()
346+
for filename in quadlet_files:
347+
if filename.endswith('.pod'):
348+
pod_svc = quadlet_to_service(filename)
349+
elif filename.endswith('.container'):
350+
container_svcs.add(quadlet_to_service(filename))
351+
if pod_svc and pod_svc in set(changed_services) | set(new_services):
352+
changed_services = [s for s in changed_services if s not in container_svcs]
353+
new_services = [s for s in new_services if s not in container_svcs]
354+
342355
# Write quadlet files directly to the unit directory
343356
track_operation(
344357
"Creating",

0 commit comments

Comments
 (0)