File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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" ,
You can’t perform that action at this time.
0 commit comments