Skip to content

Commit

Permalink
Merge pull request containerd#10449 from rata/rata/userns-ci-fixes
Browse files Browse the repository at this point in the history
CI fixes for upcoming runc 1.2.0
  • Loading branch information
dmcgowan authored Jul 15, 2024
2 parents ac0f34f + 7c4de28 commit 42daab9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
19 changes: 19 additions & 0 deletions script/critest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,26 @@ set -eu -o pipefail
report_dir=$1

mkdir -p $report_dir

function traverse_path() {
local path=$1
cd "$path"
sudo chmod go+rx "$PWD"

while [ $PWD != "/" ]; do
sudo chmod go+x "$PWD/../"
cd ..
done
}

BDIR="$(mktemp -d -p $PWD)"
# runc needs to traverse (+x) the directories in the path to the rootfs. This is important when we
# create a user namespace, as the final stage of the runc initialization is not as root on the host.
# While containerd creates the directories with the right permissions, the right group (so only the
# hostGID has access, etc.), those directories live below $BDIR. So, to make sure runc can traverse
# the directories, let's fix the dirs from $BDIR up, as the ones below are managed by containerd
# that does the right thing.
traverse_path "$BDIR"

function cleanup() {
pkill containerd || true
Expand Down
9 changes: 9 additions & 0 deletions script/setup/config-containerd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ mkdir -p /etc/containerd

cat << EOF | sudo tee /etc/containerd/config.toml
version = 2
[plugins."io.containerd.snapshotter.v1.overlayfs"]
# slow_chown is needed to avoid an error with kernel < 5.19:
# > "snapshotter \"overlayfs\" doesn't support idmap mounts on this host,
# > configure \`slow_chown\` to allow a slower and expensive fallback"
# https://github.com/containerd/containerd/pull/9920#issuecomment-1978901454
# This is safely ignored for kernel >= 5.19.
slow_chown = true
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
enable_selinux = ${enable_selinux}
Expand Down
2 changes: 1 addition & 1 deletion script/setup/critools-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.30.0
v1.30.1

0 comments on commit 42daab9

Please sign in to comment.