File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import (
1414 "github.com/containers/buildah/define"
1515 "github.com/containers/buildah/pkg/cli"
1616 "github.com/containers/buildah/pkg/parse"
17+ "github.com/opencontainers/cgroups"
1718 ispecs "github.com/opencontainers/image-spec/specs-go"
1819 rspecs "github.com/opencontainers/runtime-spec/specs-go"
1920 "github.com/sirupsen/logrus"
@@ -231,6 +232,11 @@ func main() {
231232 return
232233 }
233234
235+ cgroupsv2 := cgroups .IsCgroup2UnifiedMode ()
236+ if ! cgroupsv2 {
237+ logrus .Fatalf ("Did not detect Cgroups v2 on your system. Please switch to Cgroups v2." )
238+ }
239+
234240 // Hard code TMPDIR functions to use $TMPDIR or /var/tmp
235241 os .Setenv ("TMPDIR" , parse .GetTempDir ())
236242
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import (
1414 "github.com/containers/buildah/util"
1515 v1 "github.com/opencontainers/image-spec/specs-go/v1"
1616 "github.com/sirupsen/logrus"
17- "go.podman.io/common/pkg/cgroups"
1817 "go.podman.io/storage"
1918 "go.podman.io/storage/pkg/system"
2019 "go.podman.io/storage/pkg/unshare"
@@ -51,10 +50,6 @@ func hostInfo() map[string]any {
5150 info ["cpus" ] = runtime .NumCPU ()
5251 info ["rootless" ] = unshare .IsRootless ()
5352
54- _ , err := cgroups .IsCgroup2UnifiedMode ()
55- if err != nil {
56- logrus .Error (err , "err reading cgroups mode" )
57- }
5853 ociruntime := util .Runtime ()
5954 info ["OCIRuntime" ] = ociruntime
6055
You can’t perform that action at this time.
0 commit comments