Convert pod cgroupPath to runc format for systemd cgroup
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
parent
d3bc6ab693
commit
3fefcaa1dd
1 changed files with 7 additions and 5 deletions
|
@ -321,14 +321,16 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
|
||||||
cgroupParent := req.GetConfig().GetLinux().CgroupParent
|
cgroupParent := req.GetConfig().GetLinux().CgroupParent
|
||||||
if cgroupParent != "" {
|
if cgroupParent != "" {
|
||||||
if s.config.CgroupManager == "systemd" {
|
if s.config.CgroupManager == "systemd" {
|
||||||
cgPath := cgroupParent + ":" + "crio" + ":" + id
|
cgPath, err := convertCgroupNameToSystemd(cgroupParent, false)
|
||||||
g.SetLinuxCgroupsPath(cgPath)
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
g.SetLinuxCgroupsPath(cgPath + ":" + "crio" + ":" + id)
|
||||||
|
sb.cgroupParent = cgPath
|
||||||
} else {
|
} else {
|
||||||
g.SetLinuxCgroupsPath(cgroupParent + "/" + id)
|
g.SetLinuxCgroupsPath(cgroupParent + "/" + id)
|
||||||
|
sb.cgroupParent = cgroupParent
|
||||||
}
|
}
|
||||||
sb.cgroupParent = cgroupParent
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hostNetwork := req.GetConfig().GetLinux().GetSecurityContext().GetNamespaceOptions().HostNetwork
|
hostNetwork := req.GetConfig().GetLinux().GetSecurityContext().GetNamespaceOptions().HostNetwork
|
||||||
|
|
Loading…
Reference in a new issue