Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fail pipelinerun if any of nested pipelines fails. #384

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions integration-tests/pipelines/e2e-main-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ spec:
set -euo pipefail

GIT_REPO="$(jq -r '.git.repo // empty' <<< $JOB_SPEC)"
KONFLUX_TENANT="${KONFLUX_NAMESPACE%-tenant}"

if [[ "${GIT_REPO}" = "rhtap-cli" ]]; then
REPO_ORG=$(jq -r '.git.source_repo_org' <<< $JOB_SPEC)
Expand Down Expand Up @@ -144,8 +145,6 @@ spec:
--prefix-name "e2e-$OCP_VERSION"\
-o name)

KONFLUX_TENANT="${KONFLUX_NAMESPACE%-tenant}"

echo "Started new pipelinerun: https://console.redhat.com/application-pipeline/workspaces/${KONFLUX_TENANT}/applications/${KONFLUX_APPLICATION_NAME}/pipelineruns/${pipeline_run_name}"

PIPELINERUNS_ARRAY+=($pipeline_run_name)
Expand Down Expand Up @@ -182,11 +181,11 @@ spec:
## Explore and report status of all failed pipelineruns. Fail if anything failed
SOME_PIPELINE_FAILED=false
for PIPELINE_RUN in "${PIPELINERUNS_ARRAY[@]}"; do
if [[ $(oc get pipelinerun/$PIPELINE_RUN -n ${KONFLUX_NAMESPACE} -o jsonpath="{.status.conditions[?(@.type==\"Succeeded\")].status}") == "Failed" ]]; then
if [[ $(oc get pipelinerun/$PIPELINE_RUN -n ${KONFLUX_NAMESPACE} -o jsonpath="{.status.conditions[?(@.type==\"Succeeded\")].status}") == "False" ]]; then
if ! $SOME_PIPELINE_FAILED ; then
echo "List of failed PLRs:"
fi
echo "https://console.redhat.com/application-pipeline/workspaces/${KONFLUX_NAMESPACE}/applications/${KONFLUX_APPLICATION_NAME}/pipelineruns/${PIPELINE_RUN}"
echo "https://console.redhat.com/application-pipeline/workspaces/${KONFLUX_TENANT}/applications/${KONFLUX_APPLICATION_NAME}/pipelineruns/${PIPELINE_RUN}"
SOME_PIPELINE_FAILED=true
fi
done
Expand Down