Skip to content

Commit 42daab9

Browse files
authored
Merge pull request containerd#10449 from rata/rata/userns-ci-fixes
CI fixes for upcoming runc 1.2.0
2 parents ac0f34f + 7c4de28 commit 42daab9

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

script/critest.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,26 @@ set -eu -o pipefail
1919
report_dir=$1
2020

2121
mkdir -p $report_dir
22+
23+
function traverse_path() {
24+
local path=$1
25+
cd "$path"
26+
sudo chmod go+rx "$PWD"
27+
28+
while [ $PWD != "/" ]; do
29+
sudo chmod go+x "$PWD/../"
30+
cd ..
31+
done
32+
}
33+
2234
BDIR="$(mktemp -d -p $PWD)"
35+
# runc needs to traverse (+x) the directories in the path to the rootfs. This is important when we
36+
# create a user namespace, as the final stage of the runc initialization is not as root on the host.
37+
# While containerd creates the directories with the right permissions, the right group (so only the
38+
# hostGID has access, etc.), those directories live below $BDIR. So, to make sure runc can traverse
39+
# the directories, let's fix the dirs from $BDIR up, as the ones below are managed by containerd
40+
# that does the right thing.
41+
traverse_path "$BDIR"
2342

2443
function cleanup() {
2544
pkill containerd || true

script/setup/config-containerd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ mkdir -p /etc/containerd
3030

3131
cat << EOF | sudo tee /etc/containerd/config.toml
3232
version = 2
33+
34+
[plugins."io.containerd.snapshotter.v1.overlayfs"]
35+
# slow_chown is needed to avoid an error with kernel < 5.19:
36+
# > "snapshotter \"overlayfs\" doesn't support idmap mounts on this host,
37+
# > configure \`slow_chown\` to allow a slower and expensive fallback"
38+
# https://github.com/containerd/containerd/pull/9920#issuecomment-1978901454
39+
# This is safely ignored for kernel >= 5.19.
40+
slow_chown = true
41+
3342
[plugins]
3443
[plugins."io.containerd.grpc.v1.cri"]
3544
enable_selinux = ${enable_selinux}

script/setup/critools-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.30.0
1+
v1.30.1

0 commit comments

Comments
 (0)