Skip to content

Commit

Permalink
Add workaround for buildah parallel bug
Browse files Browse the repository at this point in the history
Need --layers=false in podman build, otherwise a buildah race
can trigger "layer not known" failures:

   containers/buildah#5674

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed Sep 17, 2024
1 parent 5fc3de5 commit b3da5be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,9 @@ RUN rm /etc/mtab
EOF
expected="'/etc/mtab' -> '/proc/mounts'"

# --layers=false needed to work around buildah#5674 parallel flake
local iname=nomtab-$(safename)
run_podman build -t $iname $tmpdir
run_podman build -t $iname --layers=false $tmpdir
run_podman run --rm $iname stat -c %N /etc/mtab
is "$output" "$expected" "/etc/mtab should be created"

Expand Down Expand Up @@ -1080,8 +1081,9 @@ echo -e "#!/bin/sh\nfalse" >> /usr/bin/nsenter; \
chmod +x /usr/bin/nsenter
EOF

# --layers=false needed to work around buildah#5674 parallel flake
test_image="cve_2022_1227_test-$(safename)"
run_podman build -t $test_image $tmpbuilddir
run_podman build -t $test_image --layers=false $tmpbuilddir
run_podman run -d ${keepid} $test_image top
ctr="$output"
run_podman top $ctr huser,user
Expand Down
5 changes: 3 additions & 2 deletions test/system/060-mount.bats
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ FROM $IMAGE
RUN mkdir /mountroot && echo ${datacontent[img]} > /mountroot/data
EOF

# --layers=false needed to work around buildah#5674 parallel flake
img="localhost/img-$(safename)"
run_podman build -t $img -f $dockerfile
run_podman build -t $img --layers=false -f $dockerfile

# Each test is set up in exactly the same way:
#
Expand Down Expand Up @@ -554,7 +555,7 @@ glob | /* | /mountroot/ | in
echo "$datafile_contents" > $workdir/$datafile
ln -s $datafile $workdir/link

run_podman create --mount type=glob,src=$workdir/*,dst=/mountroot/,no-dereference --privileged $img sh -c "stat -c '%N' /mountroot/link; cat /mountroot/link"
run_podman create --mount type=glob,src=$workdir/*,dst=/mountroot/,no-dereference --privileged $img sh -c "stat -c '%N' /mountroot/link; cat /mountroot/link; ls -l /mountroot"
cid="$output"
run_podman start -a $cid
assert "${lines[0]}" = "'/mountroot/link' -> '$datafile'" "symlink is preserved, on start"
Expand Down

0 comments on commit b3da5be

Please sign in to comment.