Skip to content

Commit ca5072a

Browse files
authored
Fix cert-project-check and release pipeline (#728)
An `else` condition in cert-project-check was removed by mistake in #727: the check is now fixed. Also fixed a failure in the release pipeline when the PR only affects catalogs of an FBC-enabled operator. Signed-off-by: Maurizio Porrato <[email protected]>
1 parent b3f2392 commit ca5072a

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

ansible/roles/operator-pipeline/templates/openshift/tasks/add-bundle-to-index.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ spec:
7171
7272
ENV=$(params.environment)
7373
INDEX_IMAGES="$(params.index_images)"
74+
if [[ $ENV != "prod" ]]; then
75+
# Replace registry urls with stage urls when in preprod
76+
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
77+
fi
78+
7479
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
7580
echo "Adding bundle to an index is a NOOP for dev and qa environments at this time."
7681
echo -n "success" | tee "$(results.status.path)"
7782
# output dummy/test values for following tasks
78-
echo -n "$(params.bundle_pullspec)" | tee "$(workspaces.output.path)/index-image-paths.txt"
83+
echo -n "placeholder" | tee "$(workspaces.output.path)/index-image-paths.txt"
7984
exit 0
8085
fi
8186
82-
if [[ $ENV != "prod" ]]; then
83-
# Replace registry urls with stage urls when in preprod
84-
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
85-
fi
86-
8787
EXTRA_ARGS=""
8888
if [[ "$(workspaces.credentials.bound)" == "true" ]]; then
8989
EXTRA_ARGS+=" --authfile $(workspaces.credentials.path)/.dockerconfigjson"

ansible/roles/operator-pipeline/templates/openshift/tasks/build-fbc-index-images.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,18 @@ spec:
7575
7676
ENV=$(params.environment)
7777
INDEX_IMAGES="$(params.index_images)"
78-
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
79-
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
80-
exit 0
81-
fi
82-
8378
if [[ $ENV != "prod" ]]; then
8479
# Replace registry urls with stage urls when in preprod
8580
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
8681
fi
8782
83+
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
84+
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
85+
# output dummy/test values for following tasks
86+
echo -n "placeholder" | tee "$(workspaces.output.path)/fbc-index-image-paths.txt"
87+
exit 0
88+
fi
89+
8890
add-fbc-fragments-to-index \
8991
--iib-url "$(params.iib_url)" \
9092
--indices $INDEX_IMAGES \
@@ -117,16 +119,18 @@ spec:
117119
118120
ENV=$(params.environment)
119121
INDEX_IMAGES="$(params.index_images)"
120-
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
121-
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
122-
exit 0
123-
fi
124-
125122
if [[ $ENV != "prod" ]]; then
126123
# Replace registry urls with stage urls when in preprod
127124
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
128125
fi
129126
127+
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
128+
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
129+
# output dummy/test values for following tasks
130+
echo -n "placeholder" | tee "$(workspaces.output.path)/fbc-index-image-paths.txt"
131+
exit 0
132+
fi
133+
130134
rm-operator-from-index \
131135
--iib-url "$(params.iib_url)" \
132136
--indices $INDEX_IMAGES \

ansible/roles/operator-pipeline/templates/openshift/tasks/cert-project-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ spec:
3131
echo -n "" | tee $(results.certification_project_id.path)
3232
exit 0
3333
fi
34-
if [ "$(params.operator_path)" != "" ]; then
35-
PKG_PATH="$(params.operator_path)"
34+
35+
if [ -z "$(params.operator_path)" ]; then
3636
echo "Operator path is missing."
3737
exit 1
3838
fi
3939
40-
CI_FILE_PATH="$PKG_PATH/ci.yaml"
40+
CI_FILE_PATH="$(params.operator_path)/ci.yaml"
4141
4242
CERT_PROJECT_ID=$(cat $CI_FILE_PATH | yq -r '.cert_project_id | select (.!=null)')
4343

ansible/roles/operator-pipeline/templates/openshift/tasks/get-manifest-digests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
# output dummy/test values for signing purposes
3232
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
3333
echo -n "registry.redhat.io/redhat/test-operator-index:v4.9" | tee "$(results.docker_references.path)"
34-
echo "$(params.index_image_paths)" | awk -F '+' '{print $2}' | tee "$(results.manifest_digests.path)"
34+
echo "" | tee "$(results.manifest_digests.path)"
3535
echo "Getting manifest digests is a NOOP for dev and qa environments at this time."
3636
exit 0
3737
fi

0 commit comments

Comments
 (0)