File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -449,6 +449,11 @@ def delete(self):
449449 shutil .rmtree (self ._host_tmp_dir )
450450 LOG .debug ("Successfully removed temporary directory %s on the host." , self ._host_tmp_dir )
451451
452+ # Restore any symlinks that were temporarily replaced with directories
453+ # during container creation for mount compatibility (Finch/containerd).
454+ # Done at delete time so the bind mounts remain valid for the container's lifetime.
455+ self ._restore_mapped_symlinks ()
456+
452457 self .id = None
453458
454459 def start (self , input_data = None ):
@@ -486,11 +491,6 @@ def start(self, input_data=None):
486491 if "Ports are not available" in str (ex ):
487492 raise PortAlreadyInUse (ex .explanation .decode ()) from ex
488493 raise ex
489- finally :
490- # Restore any symlinks that were temporarily replaced with directories
491- # during container creation for mount compatibility (Finch/containerd).
492- # Must happen after start() since containerd resolves mounts at start time.
493- self ._restore_mapped_symlinks ()
494494
495495 def _initialize_concurrency_control (self ):
496496 """
You can’t perform that action at this time.
0 commit comments