cluster/gce/gci: revert PATH change when using custom runc

Commit 6031ff29c1
("make containerd download more robust") updated the containerd systemd
unit to use `Environment=PATH=/home/containerd/bin:$PATH`. However,
environment variables are not evaluated in systemd units in that way.
This resulted in containerd running with the literal value
`/home/containerd/bin:$PATH` for its PATH, breaking containerd (it could
not access the apparmor_parser program).

The old way passes the PATH that configure.sh runs with to containerd,
which is not optimal, but at least it doesn't break the tests. Let's
revert to the old way.
This commit is contained in:
Robert Kolchmeyer
2025-10-08 16:19:01 -07:00
parent 6bc4914b84
commit 3ec711f91e

View File

@@ -610,7 +610,7 @@ function install-containerd-cos {
if download-robust "runc ${COS_INSTALL_RUNC_VERSION}" "${temp_dir}" \
"https://github.com/opencontainers/runc/releases/download/${COS_INSTALL_RUNC_VERSION}/runc.${HOST_ARCH}"; then
cp "${temp_dir}/runc.${HOST_ARCH}" /home/containerd/bin/runc && chmod 755 /home/containerd/bin/runc
sed -i "/\[Service\]/a Environment=PATH=/home/containerd/bin:\$PATH" /etc/systemd/system/containerd.service
sed -i "/\[Service\]/a Environment=PATH=/home/containerd/bin:$PATH" /etc/systemd/system/containerd.service
fi
rm -rf "${temp_dir}"
fi