From ce30d2d5c853af506318fbbcadc018574524ccd8 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 27 Feb 2020 18:49:10 -0800 Subject: [PATCH] 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. --- test/images/image-util.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/images/image-util.sh b/test/images/image-util.sh index b750449f963..cd4b929692d 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -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}"