docker_confirm: accept locally built images when pull fails

A locally built tag (test_locally.sh or docker build) is not on a
registry, so the pull phase reported hard failures on a machine that was
actually fine. Degrade to a warn when the image is present locally;
missing images still fail.
This commit is contained in:
Daniel Han 2026-06-12 18:06:40 +00:00
commit d01da4c827
2 changed files with 11 additions and 1 deletions

View file

@ -89,7 +89,13 @@ foreach ($img in @($BASE_IMAGE, $IMAGE)) {
} else {
$log = Join-Path $WORK ("pull_" + ($img -replace "[/:]", "_") + ".log")
docker pull $img *> $log
if ($LASTEXITCODE -eq 0) { Ok "pulled $img" } else { Bad "could not pull $img (see $log)" }
if ($LASTEXITCODE -eq 0) { Ok "pulled $img" }
else {
docker image inspect $img *> $null
# Locally built tags are not on a registry; presence is what matters.
if ($LASTEXITCODE -eq 0) { Warn "not pullable but present locally: $img" }
else { Bad "could not pull $img (see $log)" }
}
}
}
Hr

View file

@ -123,6 +123,10 @@ for img in "$BASE_IMAGE" "$IMAGE"; do
docker image inspect "$img" >/dev/null 2>&1 && ok "local image present: $img" || bad "SKIP_PULL=1 but image missing locally: $img"
elif docker pull "$img" >"$WORK/pull_$(echo "$img" | tr '/:' '__').log" 2>&1; then
ok "pulled $img"
elif docker image inspect "$img" >/dev/null 2>&1; then
# Locally built tags (test_locally.sh / docker build) are not on a
# registry; that is fine as long as the image is present.
warn "not pullable but present locally: $img"
else
bad "could not pull $img (see $WORK/pull_*.log)"
fi