Skip to content

Commit 0669581

Browse files
authored
Merge pull request kubernetes#88892 from claudiubelu/image-promoter/build-and-push
test images: Skip building manifest list if no image was pushed
2 parents 5708511 + ce30d2d commit 0669581

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/images/image-util.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,13 @@ push() {
204204
# Windows images into the manifest list.
205205
if test -z "${REMOTE_DOCKER_URL:-}" && printf "%s\n" "$os_archs" | grep -q '^windows'; then
206206
echo "Skipping pushing the image '${image}' for Windows. REMOTE_DOCKER_URL_\${os_version} should be set, containing the URL to a Windows docker daemon."
207-
os_archs=$(printf "%s\n" "$os_archs" | grep -v "^windows")
207+
os_archs=$(printf "%s\n" "$os_archs" | grep -v "^windows" || true)
208+
fi
209+
210+
if test -z "${os_archs}"; then
211+
# this can happen for Windows-only images if they have been skipped entirely.
212+
echo "No image for the manifest list. Skipping ${image}."
213+
return
208214
fi
209215

210216
kube::util::ensure-gnu-sed
@@ -238,7 +244,7 @@ push() {
238244
}
239245

240246
# This function is for building AND pushing images. Useful if ${WHAT} is "all-conformance".
241-
# This will allow images to be pushed immediately after they've been pushed.
247+
# This will allow images to be pushed immediately after they've been built.
242248
build_and_push() {
243249
image=$1
244250
build "${image}"

0 commit comments

Comments
 (0)