From bcab10a4787abee1b8ccdf895b7468b6fc258672 Mon Sep 17 00:00:00 2001 From: Raj Chaudhuri Date: Sun, 17 Mar 2024 16:39:48 +0530 Subject: [PATCH] When publishing images, the :latest tag will not be applied if the current tag includes -beta --- reweave/tools/build-images.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reweave/tools/build-images.sh b/reweave/tools/build-images.sh index c9304c76..aba12a57 100755 --- a/reweave/tools/build-images.sh +++ b/reweave/tools/build-images.sh @@ -39,7 +39,14 @@ build_image() { IMAGENAME=$2 IMAGETAG=${IMAGENAME}:${IMAGE_VERSION} if [ "$PUBLISH" = "true" ]; then - PUBLISHTAGOPT="-t ${IMAGENAME}:latest" + # When an image is published to a registry, also tag it + # with ':latest', unless the image version string + # contains '-beta' + case "$IMAGE_VERSION" in + *-beta*) IS_BETA=1 ;; + *) IS_BETA= ;; + esac + [ -z "${IS_BETA}" ] && PUBLISHTAGOPT="-t ${IMAGENAME}:latest" else PUBLISHTAGOPT="" fi