diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-29 10:53:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-29 10:53:41 -0400 |
commit | 6ac009d5304127f6758be157c7302646e5a481e5 (patch) | |
tree | 75f186484198eb84f18c575e86032e25d5e819a3 /libpod/container_internal_linux.go | |
parent | 771c887010709cdf718be252ca91a852c6735da7 (diff) | |
parent | 6ee5f740a4ecb70636b888e78b02065ee984636c (diff) | |
download | podman-6ac009d5304127f6758be157c7302646e5a481e5.tar.gz podman-6ac009d5304127f6758be157c7302646e5a481e5.tar.bz2 podman-6ac009d5304127f6758be157c7302646e5a481e5.zip |
Merge pull request #6666 from giuseppe/conmon-delegate
podman: add new cgroup mode split
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 5ee6726e0..2c78f6bd2 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -31,6 +31,7 @@ import ( "github.com/containers/libpod/pkg/resolvconf" "github.com/containers/libpod/pkg/rootless" "github.com/containers/libpod/pkg/util" + "github.com/containers/libpod/utils" "github.com/containers/storage/pkg/archive" securejoin "github.com/cyphar/filepath-securejoin" "github.com/opencontainers/runc/libcontainer/user" @@ -1505,8 +1506,17 @@ func (c *Container) getOCICgroupPath() (string, error) { switch { case (rootless.IsRootless() && !unified) || c.config.NoCgroups: return "", nil + case c.config.CgroupsMode == cgroupSplit: + if c.config.CgroupParent != "" { + return c.config.CgroupParent, nil + } + selfCgroup, err := utils.GetOwnCgroup() + if err != nil { + return "", err + } + return filepath.Join(selfCgroup, "container"), nil case c.runtime.config.Engine.CgroupManager == config.SystemdCgroupsManager: - // When runc is set to use Systemd as a cgroup manager, it + // When the OCI runtime is set to use Systemd as a cgroup manager, it // expects cgroups to be passed as follows: // slice:prefix:name systemdCgroups := fmt.Sprintf("%s:libpod:%s", path.Base(c.config.CgroupParent), c.ID()) |