Merge pull request #6082 from Dragoncell/cgroupv2_fix

modify the way for checking cos
This commit is contained in:
Maksym Pavlenko 2021-10-05 16:21:37 -07:00 committed by GitHub
commit 97e2016409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,10 @@ fi
if [ "${CONTAINERD_CGROUPV2:-"false"}" == "true" ]; then if [ "${CONTAINERD_CGROUPV2:-"false"}" == "true" ]; then
# check cos image # check cos image
if uname -a | grep -q cos; then if [ -r /etc/os-release ]; 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; then
echo "Setting up cgroupv2" echo "Setting up cgroupv2"