Skip to content

Commit f9228f3

Browse files
committed
Handle arm64 architecture in gather-must-gather step
* Download the right mco-sanitize binary by replacing the arch string to match the download site structure * As `camgi` is only available for x86_64, gracefully skip it on other architectures to let the script proceed
1 parent 5c2b4e2 commit f9228f3

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

ci-operator/step-registry/gather/must-gather/gather-must-gather-commands.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ fi
285285
MUST_GATHER_TIMEOUT=${MUST_GATHER_TIMEOUT:-"15m"}
286286

287287
# Download the binary from mirror
288-
curl -sL "https://mirror.openshift.com/pub/ci/$(arch)/mco-sanitize/mco-sanitize" > /tmp/mco-sanitize
288+
# Transform aarch64 -> arm64 to match mirror directory structure
289+
ARCH=$(arch | sed 's/aarch64/arm64/')
290+
curl -sL "https://mirror.openshift.com/pub/ci/${ARCH}/mco-sanitize/mco-sanitize" > /tmp/mco-sanitize
289291
chmod +x /tmp/mco-sanitize
290292

291293
set -x # log the MG commands
@@ -307,9 +309,14 @@ if ! /tmp/mco-sanitize --input="${ARTIFACT_DIR}/must-gather"; then
307309
fi
308310

309311
[ -f "${ARTIFACT_DIR}/must-gather/event-filter.html" ] && cp "${ARTIFACT_DIR}/must-gather/event-filter.html" "${ARTIFACT_DIR}/event-filter.html"
310-
installCamgi
311-
/tmp/camgi "${ARTIFACT_DIR}/must-gather" > "${ARTIFACT_DIR}/must-gather/camgi.html"
312-
[ -f "${ARTIFACT_DIR}/must-gather/camgi.html" ] && cp "${ARTIFACT_DIR}/must-gather/camgi.html" "${ARTIFACT_DIR}/camgi.html"
312+
# camgi only has x86_64 builds available, skip on other architectures
313+
if [ "$ARCH" = "x86_64" ]; then
314+
installCamgi
315+
/tmp/camgi "${ARTIFACT_DIR}/must-gather" > "${ARTIFACT_DIR}/must-gather/camgi.html"
316+
[ -f "${ARTIFACT_DIR}/must-gather/camgi.html" ] && cp "${ARTIFACT_DIR}/must-gather/camgi.html" "${ARTIFACT_DIR}/camgi.html"
317+
else
318+
echo "Skipping camgi (only available for x86_64 architecture)"
319+
fi
313320
tar -czC "${ARTIFACT_DIR}/must-gather" -f "${ARTIFACT_DIR}/must-gather.tar.gz" .
314321
rm -rf "${ARTIFACT_DIR}"/must-gather
315322
set +x # stop logging commands

0 commit comments

Comments
 (0)