diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-05-06 09:39:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-06 09:39:03 -0400 |
commit | 176ae99187de9068670dac1fb3ec30e11cd3dd93 (patch) | |
tree | b1cb4cd71bf7ea541f3336ee2a79d83eacdb22c2 /libpod/runtime_ctr.go | |
parent | 5fa31e10e364e57f7bdc4bb00f483b7f6a631ee0 (diff) | |
parent | 27ac750c7d949fc5922c4a11bf3e8e4606dd2a04 (diff) | |
download | podman-176ae99187de9068670dac1fb3ec30e11cd3dd93.tar.gz podman-176ae99187de9068670dac1fb3ec30e11cd3dd93.tar.bz2 podman-176ae99187de9068670dac1fb3ec30e11cd3dd93.zip |
Merge pull request #10234 from giuseppe/fix-cgroupfs-pod
cgroup: fix rootless --cgroup-parent with pods
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 328f47c12..7d31e392f 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -295,7 +295,10 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai if podCgroup == "" { return nil, errors.Wrapf(define.ErrInternal, "pod %s cgroup is not set", pod.ID()) } - ctr.config.CgroupParent = podCgroup + canUseCgroup := !rootless.IsRootless() || isRootlessCgroupSet(podCgroup) + if canUseCgroup { + ctr.config.CgroupParent = podCgroup + } } else if !rootless.IsRootless() { ctr.config.CgroupParent = CgroupfsDefaultCgroupParent } |