sandbox remove: unmount shm before removing infra container
@@ -44,6 +44,10 @@ func (s *Server) removePodSandbox(ctx context.Context, sb *sandbox.Sandbox) erro
}
}
+ if err := sb.UnmountShm(); err != nil {
+ return errors.Wrap(err, "unable to unmount SHM")
+ }
+
s.removeInfraContainer(sb.InfraContainer())
if err := s.removeContainerInPod(ctx, sb, sb.InfraContainer()); err != nil {
return err
@@ -54,10 +58,6 @@ func (s *Server) removePodSandbox(ctx context.Context, sb *sandbox.Sandbox) erro
return errors.Wrap(err, "stop pod network")
}
- if err := sb.UnmountShm(); err != nil {
- return errors.Wrap(err, "unable to unmount SHM")
- }
-
if err := sb.RemoveManagedNamespaces(); err != nil {
return errors.Wrap(err, "unable to remove managed namespaces")
}
