Merge pull request #231 from mheon/fix_rootless_systemd

Ensure that rootless cgroupsv1 will select cgroupfs
This commit is contained in:
Daniel J Walsh 2020-07-22 05:43:21 -04:00 committed by GitHub
commit 08e2e3dd92
1 changed files with 10 additions and 0 deletions

View File

@ -2,7 +2,17 @@
package config
import (
"github.com/containers/common/pkg/cgroupv2"
"github.com/containers/storage/pkg/unshare"
)
func defaultCgroupManager() string {
enabled, err := cgroupv2.Enabled()
if err == nil && !enabled && unshare.IsRootless() {
return CgroupfsCgroupsManager
}
return SystemdCgroupsManager
}
func defaultEventsLogger() string {