Skip to content

Commit 4477b9d

Browse files
committed
sandbox_remove: Ensure that the pod infra container exit file is removed
Signed-off-by: Mrunal Patel <[email protected]>
1 parent b0ef01d commit 4477b9d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/sandbox_remove.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package server
22

33
import (
44
"fmt"
5+
"os"
6+
"path/filepath"
57
"time"
68

79
"github.com/containers/storage"
@@ -99,6 +101,9 @@ func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxR
99101
if err := s.CtrIDIndex().Delete(podInfraContainer.ID()); err != nil {
100102
return nil, fmt.Errorf("failed to delete infra container %s in pod sandbox %s from index: %v", podInfraContainer.ID(), sb.ID(), err)
101103
}
104+
if err := os.Remove(filepath.Join(s.Config().RuntimeConfig.ContainerExitsDir, podInfraContainer.ID())); err != nil && !os.IsNotExist(err) {
105+
return nil, errors.Wrapf(err, "failed to remove pod infra container exit file %s", podInfraContainer.ID())
106+
}
102107

103108
s.ReleasePodName(sb.Name())
104109
s.removeSandbox(sb.ID())

0 commit comments

Comments
 (0)