Skip to content

Commit 9406e65

Browse files
committed
trial
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent b41c3b4 commit 9406e65

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

common/pkg/config/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strings"
1212

1313
units "github.com/docker/go-units"
14+
"github.com/opencontainers/cgroups"
1415
selinux "github.com/opencontainers/selinux/go-selinux"
1516
"github.com/sirupsen/logrus"
1617
"go.podman.io/common/internal/attributedstring"
@@ -745,6 +746,10 @@ func (c *EngineConfig) ImagePlatformToRuntime(os string, arch string) string {
745746
// cgroup manager. In case the user session isn't available, we're switching the
746747
// cgroup manager to cgroupfs. Note, this only applies to rootless.
747748
func (c *Config) CheckCgroupsAndAdjustConfig() {
749+
cgroupsv2 := cgroups.IsCgroup2UnifiedMode()
750+
if !cgroupsv2 {
751+
logrus.Fatalf("Did not detect Cgroups v2 on your system. Please switch to Cgroups v2.")
752+
}
748753
if !unshare.IsRootless() || c.Engine.CgroupManager != SystemdCgroupsManager {
749754
return
750755
}

0 commit comments

Comments
 (0)