cgroups: do not create $ROOT/pids on cgroupv2
add the same check we already have for other controllers, since `createCgroupDirectory` is meant to be used on cgroup v1 only. Closes: https://github.com/containers/common/issues/862 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
463f91ec52
commit
e8532febce
|
|
@ -34,6 +34,9 @@ func (c *pidHandler) Apply(ctr *CgroupControl, res *spec.LinuxResources) error {
|
|||
|
||||
// Create the cgroup
|
||||
func (c *pidHandler) Create(ctr *CgroupControl) (bool, error) {
|
||||
if ctr.cgroup2 {
|
||||
return false, nil
|
||||
}
|
||||
return ctr.createCgroupDirectory(Pids)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue