Fix vault-raft-snapshot: mc download needs -L to follow redirects

Without -L, curl silently saved dl.min.io's redirect response body
(HTML/text) as the mc binary instead of the actual binary, failing at
runtime with a confusing shell-script-interpretation error. Confirmed
live while testing the leader-detection fix end-to-end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Scooby Husky
2026-08-17 21:15:40 -05:00
co-authored by Claude Sonnet 5
parent 7206022a2b
commit 8aed0bf98e
@@ -87,7 +87,12 @@ data:
kubectl -n vault exec "$LEADER_POD" -- rm -f "/tmp/${SNAP_NAME}" kubectl -n vault exec "$LEADER_POD" -- rm -f "/tmp/${SNAP_NAME}"
echo "==> Installing mc (MinIO client)..." echo "==> Installing mc (MinIO client)..."
curl -sf https://dl.min.io/client/mc/release/linux-amd64/mc -o /tmp/mc # -L is required - dl.min.io redirects, and without it curl silently
# saves the redirect response body (a small HTML/text page) as "mc"
# instead of the actual binary, which then fails at runtime with a
# confusing "line N: <word>: No such file or directory" (bash trying
# to interpret it as a script). Confirmed live 2026-08-18.
curl -fsSL https://dl.min.io/client/mc/release/linux-amd64/mc -o /tmp/mc
chmod +x /tmp/mc chmod +x /tmp/mc
export MC_CONFIG_DIR=/tmp/.mc export MC_CONFIG_DIR=/tmp/.mc
/tmp/mc alias set vps-minio "http://${VPS_MINIO_ENDPOINT}" \ /tmp/mc alias set vps-minio "http://${VPS_MINIO_ENDPOINT}" \