test/apiv2: build healthcheck image as docker

The healthcheck inherit tests build their image with the default oci
format, which drops HEALTHCHECK. The build only warns about it and the
test sends that to /dev/null, so the image has no health config, there
is nothing to inherit and all 21 assertions come back null.

Fixes: 16a1d3fbe9 ("support healthcheck: {} inherits healthcheck from image")

Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
This commit is contained in:
Tushar Verma 2026-08-23 23:28:00 +05:30
parent 8efac905d6
commit e78fdb7c3c

View file

@ -645,7 +645,8 @@ cat >$HEALTHCHECK_INHERIT_TMPD/Dockerfile <<EOF
FROM $IMAGE
HEALTHCHECK --interval=99s --timeout=98s --start-period=97s --start-interval=96s --retries=95 CMD true
EOF
podman build -t healthcheck_inherit $HEALTHCHECK_INHERIT_TMPD &>/dev/null
# HEALTHCHECK is only recorded in the docker image format, the oci default drops it
podman build --format docker -t healthcheck_inherit $HEALTHCHECK_INHERIT_TMPD &>/dev/null
# empty Test inherits the image healthcheck unchanged (all fields preserved)
t POST containers/create Image=healthcheck_inherit Cmd='["top"]' Healthcheck='{"Test":[]}' 201 \