From 6fd1c8957ccfbcf0b1991667307690022fa831f7 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Thu, 1 Jun 2017 12:07:03 +0200 Subject: [PATCH] RemovePodSandbox must be idempotent Signed-off-by: Antonio Murdaca --- server/sandbox_remove.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/sandbox_remove.go b/server/sandbox_remove.go index 09f2d054..763ffb03 100644 --- a/server/sandbox_remove.go +++ b/server/sandbox_remove.go @@ -8,6 +8,7 @@ import ( "github.com/containers/storage" "github.com/docker/docker/pkg/mount" "github.com/kubernetes-incubator/cri-o/oci" + pkgstorage "github.com/kubernetes-incubator/cri-o/pkg/storage" "github.com/opencontainers/selinux/go-selinux/label" "golang.org/x/net/context" pb "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime" @@ -96,7 +97,7 @@ func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxR if err := s.storageRuntimeServer.StopContainer(sb.id); err != nil { logrus.Warnf("failed to stop sandbox container in pod sandbox %s: %v", sb.id, err) } - if err := s.storageRuntimeServer.RemovePodSandbox(sb.id); err != nil { + if err := s.storageRuntimeServer.RemovePodSandbox(sb.id); err != nil && err != pkgstorage.ErrInvalidSandboxID { return nil, fmt.Errorf("failed to remove pod sandbox %s: %v", sb.id, err) }