Skip to content

Commit bdc8521

Browse files
committed
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 <[email protected]>
1 parent 2e6d570 commit bdc8521

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/e2e_node/gci-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [ "${CONTAINERD_CGROUPV2:-"false"}" == "true" ]; then
3030
OS_ID="$(. /etc/os-release && echo "$ID")"
3131
fi
3232
if [ "${OS_ID}" = "cos" ]; then
33-
if ! grep -q 'systemd.unified_cgroup_hierarchy=true' /proc/cmdline; then
33+
if ! grep -q 'systemd.unified_cgroup_hierarchy=true' /proc/cmdline && [ "$(stat -fc %T /sys/fs/cgroup/)" != "cgroup2fs" ]; then
3434
echo "Setting up cgroupv2"
3535

3636
mount_path="/tmp/esp"

0 commit comments

Comments
 (0)