From e4594c8cdf7e9a6db3c5c2cec7b2a4cc7fd7b164 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Tue, 28 Jan 2025 10:44:06 +0100 Subject: [PATCH] Abort `render-pipeline` when we get a `null` catalog URL Abort `render-pipeline` script when Lieutenant API returns no catalog URL for a cluster. This makes the failure mode more obvious than unexpected failing compile jobs for some clusters (usually with an error like "fatal: unable to access '': The requested URL returned error: 403". --- gitlab/bin/step-render-pipeline | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitlab/bin/step-render-pipeline b/gitlab/bin/step-render-pipeline index 763bb19..c8146dd 100755 --- a/gitlab/bin/step-render-pipeline +++ b/gitlab/bin/step-render-pipeline @@ -4,6 +4,10 @@ set -e -u -x cluster_catalog_urls="" for c in ${CLUSTERS}; do r=$(curl -sH"Authorization: Bearer ${COMMODORE_API_TOKEN}" "${COMMODORE_API_URL}/clusters/${c}" | jq -r .gitRepo.url) + if [ "$r" = "null" ]; then + echo "Got 'null' for catalog URL fo cluster ${c}, aborting..." + exit 1 + fi cluster_catalog_urls="${cluster_catalog_urls}${c}=${r} " done