From bdc852190bcedbc74dd812acc6e358889090bf73 Mon Sep 17 00:00:00 2001 From: David Porter Date: Sat, 8 Jan 2022 16:00:58 -0800 Subject: [PATCH] test: e2e node COS cgroupv2 script On newer COS M97 images, cgroupv2 is enabled out of the box. It is enabled using default systemd configuration and does not have `systemd.unified_cgroup_hierarchy` present `/proc/cmdline`. As a result, the check for manual cgroupv2 enablement should be improved to not only check `/proc/cmdline`, but also to see if it's enabled on the system using `stat -fc %T /sys/fs/cgroup/` Signed-off-by: David Porter --- test/e2e_node/gci-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e_node/gci-init.sh b/test/e2e_node/gci-init.sh index c24be53b7..83da28194 100755 --- a/test/e2e_node/gci-init.sh +++ b/test/e2e_node/gci-init.sh @@ -30,7 +30,7 @@ if [ "${CONTAINERD_CGROUPV2:-"false"}" == "true" ]; then OS_ID="$(. /etc/os-release && echo "$ID")" fi if [ "${OS_ID}" = "cos" ]; then - if ! grep -q 'systemd.unified_cgroup_hierarchy=true' /proc/cmdline; then + if ! grep -q 'systemd.unified_cgroup_hierarchy=true' /proc/cmdline && [ "$(stat -fc %T /sys/fs/cgroup/)" != "cgroup2fs" ]; then echo "Setting up cgroupv2" mount_path="/tmp/esp"