libpod/runtime_linux.go: Remove Cgroups v1

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
Lokesh Mandvekar
2025-11-03 14:28:50 -05:00
parent 7c45f43a46
commit 5499b79c8e

View File

@@ -12,21 +12,10 @@ import (
"github.com/containers/podman/v6/pkg/rootless"
"github.com/containers/podman/v6/pkg/systemd"
"github.com/sirupsen/logrus"
"go.podman.io/common/pkg/cgroups"
)
func checkCgroups2UnifiedMode(runtime *Runtime) {
unified, _ := cgroups.IsCgroup2UnifiedMode()
// DELETE ON RHEL9
if !unified {
_, ok := os.LookupEnv("PODMAN_IGNORE_CGROUPSV1_WARNING")
if !ok {
logrus.Warn("Using cgroups-v1 which is deprecated in favor of cgroups-v2 with Podman v5 and will be removed in a future version. Set environment variable `PODMAN_IGNORE_CGROUPSV1_WARNING` to hide this warning.")
}
}
// DELETE ON RHEL9
if unified && rootless.IsRootless() && !systemd.IsSystemdSessionValid(rootless.GetRootlessUID()) {
if rootless.IsRootless() && !systemd.IsSystemdSessionValid(rootless.GetRootlessUID()) {
// If user is rootless and XDG_RUNTIME_DIR is found, podman will not proceed with /tmp directory
// it will try to use existing XDG_RUNTIME_DIR
// if current user has no write access to XDG_RUNTIME_DIR we will fail later