From a26c0eb9928d8959c6a237175c3d973ba0d05e7b Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 15 Aug 2016 15:00:43 -0700 Subject: [PATCH] Create pod infra container Signed-off-by: Mrunal Patel --- server/runtime.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/runtime.go b/server/runtime.go index de0e87a8..aa894980 100644 --- a/server/runtime.go +++ b/server/runtime.go @@ -105,7 +105,6 @@ func (s *Server) CreatePodSandbox(ctx context.Context, req *pb.CreatePodSandboxR g.AddAnnotation(k, v) } - // TODO: double check cgroupParent. cgroupParent := req.GetConfig().GetLinux().GetCgroupParent() if cgroupParent != "" { g.SetLinuxCgroupsPath(cgroupParent) @@ -138,6 +137,18 @@ func (s *Server) CreatePodSandbox(ctx context.Context, req *pb.CreatePodSandboxR return nil, err } + containerName := name + "-infra" + container, err := oci.NewContainer(containerName, podSandboxDir, podSandboxDir, labels, name) + if err != nil { + return nil, err + } + + if err := s.runtime.CreateContainer(container); err != nil { + return nil, err + } + + s.addContainer(container) + return &pb.CreatePodSandboxResponse{PodSandboxId: &name}, nil }