From 94a457d46a843db5f531e01811f3afdf9adfb237 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Sat, 17 Jun 2017 22:55:06 +0200 Subject: [PATCH] sandbox_run: need to stop sandbox before removing it on conflict Signed-off-by: Antonio Murdaca --- server/sandbox_run.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/sandbox_run.go b/server/sandbox_run.go index 5b50670e..cdc17446 100644 --- a/server/sandbox_run.go +++ b/server/sandbox_run.go @@ -109,6 +109,9 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest return nil, err } dupID := matches[1] + if _, err := s.StopPodSandbox(ctx, &pb.StopPodSandboxRequest{PodSandboxId: dupID}); err != nil { + return nil, err + } if _, err := s.RemovePodSandbox(ctx, &pb.RemovePodSandboxRequest{PodSandboxId: dupID}); err != nil { return nil, err }