mirror of
https://github.com/containers/podman.git
synced 2025-10-16 10:43:52 +08:00
Warn if cgroups-v1
Podman v5 will not support cgroups-v1. This commit will print a warning if it detects a cgroups-v1 system. The warning can be hidden by setting envvar `PODMAN_CGROUPSV1_WARNING`. This warning is patched out for RHEL 9 builds as cgroups-v1 will still be supported on RHEL 9 systems. Resolves: https://issues.redhat.com/browse/RUN-1957 [NO NEW TESTS NEEDED] Co-authored-by: Ed Santiago <santiago@redhat.com> Co-authored-by: Sascha Grunert <sgrunert@redhat.com> Co-authored-by: Giuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
@ -393,6 +393,15 @@ func makeRuntime(runtime *Runtime) (retErr error) {
|
||||
runtime.mergeDBConfig(dbConfig)
|
||||
|
||||
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 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
|
||||
|
Reference in New Issue
Block a user