test images: Skip building manifest list if no image was pushed

For Windows-only images, if there is no image built / pushed, you cannot create
a manifest list.
This commit is contained in:
Claudiu Belu 2020-02-27 18:49:10 -08:00
parent 5708511499
commit ce30d2d5c8

View File

@ -204,7 +204,13 @@ push() {
# Windows images into the manifest list.
if test -z "${REMOTE_DOCKER_URL:-}" && printf "%s\n" "$os_archs" | grep -q '^windows'; then
echo "Skipping pushing the image '${image}' for Windows. REMOTE_DOCKER_URL_\${os_version} should be set, containing the URL to a Windows docker daemon."
os_archs=$(printf "%s\n" "$os_archs" | grep -v "^windows")
os_archs=$(printf "%s\n" "$os_archs" | grep -v "^windows" || true)
fi
if test -z "${os_archs}"; then
# this can happen for Windows-only images if they have been skipped entirely.
echo "No image for the manifest list. Skipping ${image}."
return
fi
kube::util::ensure-gnu-sed
@ -238,7 +244,7 @@ push() {
}
# This function is for building AND pushing images. Useful if ${WHAT} is "all-conformance".
# This will allow images to be pushed immediately after they've been pushed.
# This will allow images to be pushed immediately after they've been built.
build_and_push() {
image=$1
build "${image}"