Push bundle increment postfix
When pushing bundle images to the RedHat registry if a certification fails the image cannot be deleted. Official advice from RedHat is to push images with an incremented postfix in the format "bundle:v1.1.0-1".
How to test
This change is designed to work when a tag is pushed but it exists. Sadly, most registries don't let you know that a tag exists, they just let you override it. Only RedHat is different in this. The easiest way to test this is to make login_and_push
return 0 before it pushes the image. This will force the check that verifies whether an image is pushed.
diff --git a/scripts/_common.sh b/scripts/_common.sh
index c55f564..acd2a1f 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -86,7 +86,7 @@ login_and_push() {
CERTIFIED="$2"
VERSION_OVERRIDE="$3"
_set_image_and_key "$NAME" "$VERSION_OVERRIDE"
-
+ return 0
if "$CERTIFIED"; then
if [[ -z "$KEY" ]]; then
echo "No registry key specified for $NAME, will not push!"
Then run the following command:
GITLAB_RUNNER_OPERATOR_REGISTRY=docker.io/<YOUR_DOCKERHUB_USERNAME> make VERSION=0.0.6 CERTIFIED=false build-and-push-bundle-image
You should see the following output:
Trying patch build v0.0.6-1 since previous patch exists.
Trying patch build v0.0.6-2 since previous patch exists.
Trying patch build v0.0.6-3 since previous patch exists.
Trying patch build v0.0.6-4 since previous patch exists.
Trying patch build v0.0.6-5 since previous patch exists.
Trying patch build v0.0.6-6 since previous patch exists.
Trying patch build v0.0.6-7 since previous patch exists.
Trying patch build v0.0.6-8 since previous patch exists.
Trying patch build v0.0.6-9 since previous patch exists.
Edited by Georgi N. Georgiev