diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-14 10:41:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 10:41:13 -0400 |
commit | 2b21f1f0464fb06e944c6daf4a482ab2f948d117 (patch) | |
tree | e75dbffe5051b70b5748a1aeca8b0a362815795d /libpod/container_internal_linux.go | |
parent | ad26684856551251100b945305f91246888ef153 (diff) | |
parent | b1768d3b0832f97d4c4920db05a8b41fd1b3cf86 (diff) | |
download | podman-2b21f1f0464fb06e944c6daf4a482ab2f948d117.tar.gz podman-2b21f1f0464fb06e944c6daf4a482ab2f948d117.tar.bz2 podman-2b21f1f0464fb06e944c6daf4a482ab2f948d117.zip |
Merge pull request #11520 from giuseppe/enable-cgroup-parent-test
test: enable --cgroup-parent test
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index eabe8efd2..ae029dc62 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -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) |