Skip to content

Commit e51842e

Browse files
committed
Fix pin-bundle-images list element seperator on ERROR
Send pin-bundle-images lookup failures to stderr and fail sync-bindata before entering the skopeo loop when bundle resolution fails. This avoids concatenating error text into bundle tokens and makes CI logs clearly report the actual failing bundle (for example, nova) instead of misleading skopeo invalid-reference errors. Signed-off-by: Amartya Sinha <amsinha@redhat.com>
1 parent e795160 commit e51842e

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

hack/pin-bundle-images.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,16 @@ for MOD_PATH in ${MOD_PATHS}; do
7575
fi
7676

7777
if [ -z "$SHA" ]; then
78-
echo "ERROR: Failed to find bundle image SHA for:"
79-
echo " MOD_PATH: $MOD_PATH"
80-
echo " BASE: $BASE"
81-
echo " REF: $REF"
82-
echo " REPO_URL: $REPO_URL"
83-
echo " REPO_CURL_URL: $REPO_CURL_URL"
84-
echo " Bundle: ${REPO_URL}/${BASE}-operator-bundle:$REF"
85-
echo ",EMPTY_SHA:$REF:$REPO_CURL_URL"
78+
# Send diagnostics to stderr; stdout is consumed as bundle list tokens.
79+
echo "" >&2
80+
echo "ERROR: Failed to find bundle image SHA for:" >&2
81+
echo " MOD_PATH: $MOD_PATH" >&2
82+
echo " BASE: $BASE" >&2
83+
echo " REF: $REF" >&2
84+
echo " REPO_URL: $REPO_URL" >&2
85+
echo " REPO_CURL_URL: $REPO_CURL_URL" >&2
86+
echo " Bundle: ${REPO_URL}/${BASE}-operator-bundle:$REF" >&2
87+
echo "EMPTY_SHA:$BASE:$REF:$REPO_CURL_URL" >&2
8688
exit 1
8789
fi
8890

hack/sync-bindata.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ EOF_CAT
126126

127127
}
128128

129-
for BUNDLE in $(hack/pin-bundle-images.sh | tr "," " "); do
129+
if ! BUNDLES="$(hack/pin-bundle-images.sh)"; then
130+
exit 1
131+
fi
132+
133+
for BUNDLE in $(echo "$BUNDLES" | tr "," " "); do
130134
(
131135
set +e
132136
n=0

0 commit comments

Comments
 (0)