Create pod infra container
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
9076527083
commit
a26c0eb992
1 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue