server: container_create: fix cgroupfs scopes naming
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
662e80492c
commit
dd2b4a8907
1 changed files with 15 additions and 7 deletions
|
@ -471,14 +471,22 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
||||||
specgen.SetProcessOOMScoreAdj(int(oomScoreAdj))
|
specgen.SetProcessOOMScoreAdj(int(oomScoreAdj))
|
||||||
}
|
}
|
||||||
|
|
||||||
if sb.CgroupParent() != "" {
|
var cgPath string
|
||||||
if s.config.CgroupManager == "systemd" {
|
scopePrefix := "crio"
|
||||||
cgPath := sb.CgroupParent() + ":" + "crio" + ":" + containerID
|
parent := "/crio"
|
||||||
specgen.SetLinuxCgroupsPath(cgPath)
|
useSystemd := s.config.CgroupManager == "systemd"
|
||||||
} else {
|
if useSystemd {
|
||||||
specgen.SetLinuxCgroupsPath(sb.CgroupParent() + "/" + containerID)
|
parent = "system.slice"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if sb.CgroupParent() != "" {
|
||||||
|
parent = sb.CgroupParent()
|
||||||
|
}
|
||||||
|
if useSystemd {
|
||||||
|
cgPath = parent + ":" + scopePrefix + ":" + containerID
|
||||||
|
} else {
|
||||||
|
cgPath = filepath.Join(parent, scopePrefix+"-"+containerID)
|
||||||
|
}
|
||||||
|
specgen.SetLinuxCgroupsPath(cgPath)
|
||||||
|
|
||||||
capabilities := linux.GetSecurityContext().GetCapabilities()
|
capabilities := linux.GetSecurityContext().GetCapabilities()
|
||||||
toCAPPrefixed := func(cap string) string {
|
toCAPPrefixed := func(cap string) string {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue