fix: Fix image tag for nightly builds (#1796)

* fix: Fix image tag for nightly builds

* Update hack/release.sh

Co-authored-by: Roland Huß <rhuss@redhat.com>

---------

Co-authored-by: Roland Huß <rhuss@redhat.com>
This commit is contained in:
David Simansky 2023-03-23 17:35:55 +01:00 committed by GitHub
parent c21e6605bc
commit 3a8d646264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -47,16 +47,18 @@ function build_release() {
#
# Tagging of images by the $TAG variable is done in `tag_images_in_yamls()` of hack/release.sh.
#
if [ "$(patch_version "${TAG}")" == 0 ]; then
echo "Newest .0 release - publish latest image tag"
else
local latest_minor=$(minor_version "$(latest_version)")
local current_minor=$(minor_version "${TAG}")
if ((current_minor >= latest_minor)); then
echo "Newer patch release - publish latest image tag"
if is_release_branch; then
if [ "$(patch_version "${TAG}")" == 0 ]; then
echo "Newest .0 release - publish latest image tag"
else
echo "Patch release of older minor version - do not publish lates image tag"
KO_FLAGS=$KO_FLAGS" --tags \"\""
local latest_minor=$(minor_version "$(latest_version)")
local current_minor=$(minor_version "${TAG}")
if ((current_minor >= latest_minor)); then
echo "Newer patch release - publish latest image tag"
else
echo "Patch release of older minor version - do not publish latest image tag"
KO_FLAGS=$KO_FLAGS" --tags \"\""
fi
fi
fi
echo "KO_FLAGS:${KO_FLAGS}"