Improve "podman load - from URL"

Don't assume that the loaded image will be deduplicated
with the server image.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2024-10-17 22:30:29 +02:00
parent 77ef28c14f
commit 6fd0e227b4
1 changed files with 12 additions and 2 deletions

View File

@ -234,11 +234,21 @@ verify_img_config_digest_and_name() {
-v $archive:/var/www/image.tar:Z \
-w /var/www \
$IMAGE /bin/busybox-extras httpd -f -p 80
# We now have $IMAGE pointing at the image, possibly using a zstd:chunked (TOC-based) pull
run_podman load -i $SERVER/image.tar
verify_img_config_digest_and_name $img_name
# This should move the $img_name tag ( = $IMAGE) to the result of loading the image;
# this is a non-TOC-based load, so it might or might not deduplicate the loaded image with
# the one for myweb.
# So, if we have an untagged image, its probably the one for myweb, and try to remove it.
run_podman rm -f -t0 myweb
run_podman images -a --format '{{.ID}} {{.Repository}}:{{.Tag}}'
local myweb_iid=$(echo "$output" | sed -n '/<none>:<none>/s/ .*$//p')
if [[ -n "$myweb_iid" ]]; then
run_podman rmi $myweb_iid
fi
verify_img_config_digest_and_name $img_name
}
@test "podman load - redirect corrupt payload" {