mirror of
https://github.com/containers/podman.git
synced 2025-05-20 16:47:39 +08:00
test: enable --cgroup-parent test
and fix it for running with runc. Closes: https://github.com/containers/podman/issues/11165 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -2489,11 +2489,6 @@ func (c *Container) getOCICgroupPath() (string, error) {
|
||||
switch {
|
||||
case c.config.NoCgroups:
|
||||
return "", nil
|
||||
case (rootless.IsRootless() && (cgroupManager == config.CgroupfsCgroupsManager || !unified)):
|
||||
if !isRootlessCgroupSet(c.config.CgroupParent) {
|
||||
return "", nil
|
||||
}
|
||||
return c.config.CgroupParent, nil
|
||||
case c.config.CgroupsMode == cgroupSplit:
|
||||
if c.config.CgroupParent != "" {
|
||||
return c.config.CgroupParent, nil
|
||||
@ -2510,6 +2505,11 @@ func (c *Container) getOCICgroupPath() (string, error) {
|
||||
systemdCgroups := fmt.Sprintf("%s:libpod:%s", path.Base(c.config.CgroupParent), c.ID())
|
||||
logrus.Debugf("Setting CGroups for container %s to %s", c.ID(), systemdCgroups)
|
||||
return systemdCgroups, nil
|
||||
case (rootless.IsRootless() && (cgroupManager == config.CgroupfsCgroupsManager || !unified)):
|
||||
if c.config.CgroupParent == "" || !isRootlessCgroupSet(c.config.CgroupParent) {
|
||||
return "", nil
|
||||
}
|
||||
fallthrough
|
||||
case cgroupManager == config.CgroupfsCgroupsManager:
|
||||
cgroupPath := filepath.Join(c.config.CgroupParent, fmt.Sprintf("libpod-%s", c.ID()))
|
||||
logrus.Debugf("Setting CGroup path for container %s to %s", c.ID(), cgroupPath)
|
||||
|
Reference in New Issue
Block a user