From 82adb54d20dd0c3251c4c650b8b9b9133cd60220 Mon Sep 17 00:00:00 2001 From: gursewak1997 Date: Tue, 23 Jan 2024 16:57:20 -0800 Subject: [PATCH] Add Podman v5 breaking changes checks Podman 5 will come with breaking changes affecting upgradability. CGroups v1 environments will be required to switch to CGroups v2 and CNI plugin environemnts will need to switch to netavark. In the above script we added the CLHM helpers to notifiy people of the incoming changes --- .../usr/libexec/coreos-podman-changes-check | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 overlay.d/14container/usr/libexec/coreos-podman-changes-check diff --git a/overlay.d/14container/usr/libexec/coreos-podman-changes-check b/overlay.d/14container/usr/libexec/coreos-podman-changes-check new file mode 100644 index 0000000000..deec5c5cbe --- /dev/null +++ b/overlay.d/14container/usr/libexec/coreos-podman-changes-check @@ -0,0 +1,30 @@ +#!/usr/bin/bash +# Podman is dropping support for cgroup v1 and CNI networking. +# Podman 5 changes: https://fedoraproject.org/wiki/Changes/Podman5 +# This script checks if the system nodes are still using +# cgroups v1 and CNI networking. If so, they will warned +# to move their nodes to cgroups v2 and netavark respectively. + +# Change the output color to yellow +warn=$(echo -e '\033[0;33m') +# No color +nc=$(echo -e '\033[0m') + +# For cgroup v2, the output is cgroup2fs. +# For cgroup v1, the output is tmpfs. +# Ref: https://kubernetes.io/docs/concepts/architecture/cgroups/#check-cgroup-version +cgroupVersion=$(stat -fc %T /sys/fs/cgroup/) + +if [[ $cgroupVersion == "tmpfs" ]]; then + echo -e "${warn}Podman is dropping support for cgroups v1. Move your nodes to cgroups v2 if not already${nc}" +fi + +# Podman supports two network backends Netavark and CNI. +# Netavark is the default network backend and was added in +# Podman version 4.0. CNI is deprecated and is removed +# in Podman version 5.0, in preference of Netavark. +podmanBackend=$(podman info --format "{{.Host.NetworkBackend}}") + +if [[ $podmanBackend != "netavark" ]]; then + echo -e "${warn}Podman is dropping support for CNI networking entirely. Switch to netavark${nc}" + fi