Skip to content

Commit 609d9e7

Browse files
committed
Add the new bootstrap image to default list
This is needed to ensure the bootstrap image is not unexpectedly validated by EC/Conforma which would fail since that image is not build as part of the user's application. Also change the check from an exact match to a prefix check instead. This allows for the various version tags of the task-runner-image. Ref: https://issues.redhat.com/browse/RHTAP-5219 Signed-off-by: Luiz Carvalho <[email protected]>
1 parent 93e33e3 commit 609d9e7

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

hack/wait-for-gitops-update.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ GITLAB_REPO=https://gitlab.com/$MY_GITLAB_USER/tssc-dev-gitops
66
JENKINS_REPO=https://github.com/$MY_GITHUB_USER/tssc-dev-gitops-jenkins
77

88
DEFAULT_INIT_IMAGES=(
9-
'quay.io/redhat-appstudio/dance-bootstrap-app:latest'
10-
'registry.redhat.io/ubi9/httpd-24:latest'
9+
'quay.io/redhat-appstudio/dance-bootstrap-app'
10+
'registry.access.redhat.com/rhtap-task-runner/rhtap-task-runner-rhel9'
1111
)
1212

1313
WORK=$(mktemp -d)
@@ -26,6 +26,17 @@ function getImage() {
2626
)
2727
}
2828

29+
function isDefaultImage() {
30+
local image
31+
image=$1
32+
for default_image in "${DEFAULT_INIT_IMAGES[@]}"; do
33+
if [[ "$image" =~ ^"$default_image" ]]; then
34+
return 0
35+
fi
36+
done
37+
return 1
38+
}
39+
2940
# Note, the env var name PREV_IMAGE_ENV_NAME is passed so it can be updated
3041
function promoteIfUpdated() {
3142
PREV_IMAGE_ENV_NAME=$1
@@ -36,20 +47,10 @@ function promoteIfUpdated() {
3647
echo "P: ${!PREV_IMAGE_ENV_NAME}"
3748
echo "C: $CURRENT_IMAGE"
3849

39-
DEFAULT_INIT_IMAGE="quay.io/redhat-appstudio/dance-bootstrap-app:latest"
4050
if [[ "${!PREV_IMAGE_ENV_NAME}" != "$CURRENT_IMAGE" ]]; then
4151
echo "$REPO dev changes, from ${!PREV_IMAGE_ENV_NAME} to $CURRENT_IMAGE"
4252

43-
is_default=false
44-
for default_image in "${DEFAULT_INIT_IMAGES[@]}"; do
45-
if [[ "$CURRENT_IMAGE" == "$default_image" ]]; then
46-
echo "Image changed back to default, skipping using PR to promote image"
47-
is_default=true
48-
break
49-
fi
50-
done
51-
52-
if ! "$is_default"; then
53+
if ! isDefaultImage "${CURRENT_IMAGE}"; then
5354
bash $SCRIPTDIR/rhtap-promote --repo $REPO
5455
fi
5556

@@ -67,7 +68,7 @@ function pushIfUpdated() {
6768

6869
if [[ "${!PREV_IMAGE_ENV_NAME}" != "$CURRENT_IMAGE" ]]; then
6970
echo "$REPO dev changes, from ${!PREV_IMAGE_ENV_NAME} to $CURRENT_IMAGE"
70-
if [[ "$CURRENT_IMAGE" == "$DEFAULT_INIT_IMAGE" ]]; then
71+
if isDefaultImage "${CURRENT_IMAGE}"; then
7172
echo "Image changed, skipping reset for default base image"
7273
else
7374
# jenkins update the gitops repo with a push and then run the job

rhtap/gather-deploy-images.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
44
source $SCRIPTDIR/common.sh
55

66
DEFAULT_INIT_IMAGES=(
7-
'quay.io/redhat-appstudio/dance-bootstrap-app:latest'
8-
'registry.redhat.io/ubi9/httpd-24:latest'
7+
'quay.io/redhat-appstudio/dance-bootstrap-app'
8+
'registry.access.redhat.com/rhtap-task-runner/rhtap-task-runner-rhel9'
99
)
1010

1111
function get-images-per-env() {
@@ -27,7 +27,7 @@ function get-images-per-env() {
2727
image=$(yq "$IMAGE_PATH" "$yaml_path")
2828

2929
for default_image in "${DEFAULT_INIT_IMAGES[@]}"; do
30-
if [[ "$image" == "$default_image" ]]; then
30+
if [[ "$image" =~ ^"$default_image" ]]; then
3131
# Don't check the default placeholder images
3232
continue 2 # Go to the next iteration of outer loop, different environment.
3333
fi

0 commit comments

Comments
 (0)