Skip to content

Commit

Permalink
Fix cert-project-check and release pipeline (#728)
Browse files Browse the repository at this point in the history
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 <mporrato@redhat.com>
  • Loading branch information
mporrato committed Sep 11, 2024
1 parent b3f2392 commit ca5072a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ spec:
ENV=$(params.environment)
INDEX_IMAGES="$(params.index_images)"
if [[ $ENV != "prod" ]]; then
# Replace registry urls with stage urls when in preprod
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
fi
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
echo "Adding bundle to an index is a NOOP for dev and qa environments at this time."
echo -n "success" | tee "$(results.status.path)"
# output dummy/test values for following tasks
echo -n "$(params.bundle_pullspec)" | tee "$(workspaces.output.path)/index-image-paths.txt"
echo -n "placeholder" | tee "$(workspaces.output.path)/index-image-paths.txt"
exit 0
fi
if [[ $ENV != "prod" ]]; then
# Replace registry urls with stage urls when in preprod
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
fi
EXTRA_ARGS=""
if [[ "$(workspaces.credentials.bound)" == "true" ]]; then
EXTRA_ARGS+=" --authfile $(workspaces.credentials.path)/.dockerconfigjson"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,18 @@ spec:
ENV=$(params.environment)
INDEX_IMAGES="$(params.index_images)"
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
exit 0
fi
if [[ $ENV != "prod" ]]; then
# Replace registry urls with stage urls when in preprod
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
fi
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
# output dummy/test values for following tasks
echo -n "placeholder" | tee "$(workspaces.output.path)/fbc-index-image-paths.txt"
exit 0
fi
add-fbc-fragments-to-index \
--iib-url "$(params.iib_url)" \
--indices $INDEX_IMAGES \
Expand Down Expand Up @@ -117,16 +119,18 @@ spec:
ENV=$(params.environment)
INDEX_IMAGES="$(params.index_images)"
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
exit 0
fi
if [[ $ENV != "prod" ]]; then
# Replace registry urls with stage urls when in preprod
INDEX_IMAGES=${INDEX_IMAGES//registry.redhat.io/registry.stage.redhat.io}
fi
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
echo "Adding FBC fragment to an index is a NOOP for dev and qa environments at this time."
# output dummy/test values for following tasks
echo -n "placeholder" | tee "$(workspaces.output.path)/fbc-index-image-paths.txt"
exit 0
fi
rm-operator-from-index \
--iib-url "$(params.iib_url)" \
--indices $INDEX_IMAGES \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ spec:
echo -n "" | tee $(results.certification_project_id.path)
exit 0
fi
if [ "$(params.operator_path)" != "" ]; then
PKG_PATH="$(params.operator_path)"
if [ -z "$(params.operator_path)" ]; then
echo "Operator path is missing."
exit 1
fi
CI_FILE_PATH="$PKG_PATH/ci.yaml"
CI_FILE_PATH="$(params.operator_path)/ci.yaml"
CERT_PROJECT_ID=$(cat $CI_FILE_PATH | yq -r '.cert_project_id | select (.!=null)')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
# output dummy/test values for signing purposes
if [[ $ENV == "dev" || $ENV == "qa" ]]; then
echo -n "registry.redhat.io/redhat/test-operator-index:v4.9" | tee "$(results.docker_references.path)"
echo "$(params.index_image_paths)" | awk -F '+' '{print $2}' | tee "$(results.manifest_digests.path)"
echo "" | tee "$(results.manifest_digests.path)"
echo "Getting manifest digests is a NOOP for dev and qa environments at this time."
exit 0
fi
Expand Down

0 comments on commit ca5072a

Please sign in to comment.