server: don't leak infra container if it's spoofed
@@ -87,7 +87,6 @@ func (s *Server) removeContainerInPod(ctx context.Context, sb *sandbox.Sandbox,
c.CleanupConmonCgroup()
- if !c.Spoofed() {
if err := s.StorageRuntimeServer().StopContainer(c.ID()); err != nil && err != storage.ErrContainerUnknown {
// assume container already umounted
log.Warnf(ctx, "Failed to stop container %s in pod sandbox %s: %v", c.Name(), sb.ID(), err)
@@ -95,7 +94,6 @@ func (s *Server) removeContainerInPod(ctx context.Context, sb *sandbox.Sandbox,
if err := s.StorageRuntimeServer().DeleteContainer(c.ID()); err != nil && err != storage.ErrContainerUnknown {
return fmt.Errorf("failed to delete container %s in pod sandbox %s: %v", c.Name(), sb.ID(), err)
}
- }
s.ReleaseContainerName(c.Name())
s.removeContainer(c)
