Add workaround for buildah parallel bug

Need --layers=false in podman build, otherwise a buildah race
can trigger "layer not known" failures:

   https://github.com/containers/buildah/issues/5674

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2024-09-17 10:37:08 -06:00
parent 5fc3de5583
commit b3da5be2b1
2 changed files with 7 additions and 4 deletions

View File

@ -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"
@ -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

View File

@ -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:
#
@ -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"