Skip to content

Commit 1c35ea0

Browse files
committed
Remove Cgroups v1 support (podman6)
Fixes: RUN-3567 (partly) Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 6b22f61 commit 1c35ea0

File tree

10 files changed

+54
-92
lines changed

10 files changed

+54
-92
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ require (
138138
tags.cncf.io/container-device-interface/specs-go v1.0.0 // indirect
139139
)
140140

141-
replace go.podman.io/common => github.com/lsm5/container-libs/common v0.0.0-20251014193343-b41c3b4c87fd
141+
replace go.podman.io/common => github.com/lsm5/container-libs/common v0.0.0-20251017145150-d8e5f3a7ff42

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
152152
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
153153
github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec h1:2tTW6cDth2TSgRbAhD7yjZzTQmcN25sDRPEeinR51yQ=
154154
github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec/go.mod h1:TmwEoGCwIti7BCeJ9hescZgRtatxRE+A72pCoPfmcfk=
155-
github.com/lsm5/container-libs/common v0.0.0-20251014193343-b41c3b4c87fd h1:l6X4N7DeA7W4h3WTvD6mZzsmYUqSow95XMD7I5apK74=
156-
github.com/lsm5/container-libs/common v0.0.0-20251014193343-b41c3b4c87fd/go.mod h1:kv0yXx/yrT60lUcVb86hezMGz/lXmyx3epvdFlM9du4=
155+
github.com/lsm5/container-libs/common v0.0.0-20251017145150-d8e5f3a7ff42 h1:ap41K+m613zPEpoO21W1TP+6vZzKf+tH5oL9CG6NaKc=
156+
github.com/lsm5/container-libs/common v0.0.0-20251017145150-d8e5f3a7ff42/go.mod h1:kv0yXx/yrT60lUcVb86hezMGz/lXmyx3epvdFlM9du4=
157157
github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
158158
github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
159159
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=

info.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ func hostInfo() map[string]any {
5555
if err != nil {
5656
logrus.Error(err, "err reading cgroups mode")
5757
}
58-
cgroupVersion := "v1"
59-
ociruntime := util.Runtime()
60-
if unified {
61-
cgroupVersion = "v2"
58+
if !unified {
59+
logrus.Fatalf("Did not detect Cgroups v2.")
6260
}
63-
info["CgroupVersion"] = cgroupVersion
61+
62+
ociruntime := util.Runtime()
6463
info["OCIRuntime"] = ociruntime
6564

6665
mi, err := system.ReadMemInfo()
-13 Bytes
Binary file not shown.

tests/helpers.bash

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,6 @@ function skip_if_cgroupsv2() {
700700
fi
701701
}
702702

703-
#######################
704-
# skip_if_cgroupsv1 # Some tests don't work with cgroupsv1
705-
#######################
706-
function skip_if_cgroupsv1() {
707-
if ! is_cgroupsv2; then
708-
skip "${1:-test does not work with cgroups v1}"
709-
fi
710-
}
711-
712703
##########################
713704
# skip_if_in_container #
714705
##########################

tests/run.bats

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,6 @@ _EOF
947947

948948
@test "rootless on cgroupv2 and systemd runs under user.slice" {
949949
skip_if_no_runtime
950-
skip_if_cgroupsv1
951950
skip_if_in_container
952951
skip_if_root_environment
953952
if test "$DBUS_SESSION_BUS_ADDRESS" = ""; then

tests/tutorial.bats

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ load helpers
55
@test "tutorial-cgroups" {
66
# confidence check for the sake of packages that consume our library
77
skip_if_no_runtime
8-
skip_if_cgroupsv1
98
skip_if_rootless_environment
109
skip_if_chroot
1110

vendor/go.podman.io/common/pkg/cgroups/cgroups_linux.go

Lines changed: 40 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/go.podman.io/common/pkg/cgroups/cgroups_unsupported.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ go.opentelemetry.io/otel/trace
464464
go.opentelemetry.io/otel/trace/embedded
465465
go.opentelemetry.io/otel/trace/internal/telemetry
466466
go.opentelemetry.io/otel/trace/noop
467-
# go.podman.io/common v0.65.1-0.20250916163606-92222dcd3da4 => github.com/lsm5/container-libs/common v0.0.0-20251014193343-b41c3b4c87fd
467+
# go.podman.io/common v0.65.1-0.20250916163606-92222dcd3da4 => github.com/lsm5/container-libs/common v0.0.0-20251017145150-d8e5f3a7ff42
468468
## explicit; go 1.24.2
469469
go.podman.io/common/internal
470470
go.podman.io/common/internal/attributedstring
@@ -825,4 +825,4 @@ tags.cncf.io/container-device-interface/pkg/parser
825825
# tags.cncf.io/container-device-interface/specs-go v1.0.0
826826
## explicit; go 1.19
827827
tags.cncf.io/container-device-interface/specs-go
828-
# go.podman.io/common => github.com/lsm5/container-libs/common v0.0.0-20251014193343-b41c3b4c87fd
828+
# go.podman.io/common => github.com/lsm5/container-libs/common v0.0.0-20251017145150-d8e5f3a7ff42

0 commit comments

Comments
 (0)