From 4ee041a1c16b5f88c74be8b71d5ca6e3b3e929fa Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Thu, 25 Aug 2016 12:15:20 -0700 Subject: [PATCH] Fix container removal state tracking Signed-off-by: Mrunal Patel --- server/runtime.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/runtime.go b/server/runtime.go index beee760a..9c0eb5c7 100644 --- a/server/runtime.go +++ b/server/runtime.go @@ -97,7 +97,7 @@ func (s *Server) CreatePodSandbox(ctx context.Context, req *pb.CreatePodSandboxR name: name, logDir: logDir, labels: labels, - containers: []*oci.Container{}, + containers: make(map[string]*oci.Container), }) annotations := req.GetConfig().GetAnnotations() @@ -516,6 +516,8 @@ func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerReq return nil, fmt.Errorf("failed to remove container %s directory: %v", *containerName, err) } + s.removeContainer(c) + return &pb.RemoveContainerResponse{}, nil }