File tree Expand file tree Collapse file tree 1 file changed +31
-3
lines changed
Expand file tree Collapse file tree 1 file changed +31
-3
lines changed Original file line number Diff line number Diff line change 7777
7878 FLUX_DOWNLOAD_URL="https://github.com/fluxcd/flux2/releases/download/v${VERSION}/"
7979
80- curl -fsSL -o "$DL_DIR/$FLUX_TARGET_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_TARGET_FILE"
81- curl -fsSL -o "$DL_DIR/$FLUX_CHECKSUMS_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_CHECKSUMS_FILE"
82-
80+ MAX_RETRIES=5
81+ RETRY_DELAY=5
82+
83+ for i in $(seq 1 $MAX_RETRIES); do
84+ echo "Downloading flux binary (attempt $i/$MAX_RETRIES)"
85+ if curl -fsSL -o "$DL_DIR/$FLUX_TARGET_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_TARGET_FILE"; then
86+ break
87+ fi
88+ if [ $i -lt $MAX_RETRIES ]; then
89+ echo "Download failed, retrying in ${RETRY_DELAY} seconds..."
90+ sleep $RETRY_DELAY
91+ else
92+ echo "Failed to download flux binary after $MAX_RETRIES attempts"
93+ exit 1
94+ fi
95+ done
96+
97+ for i in $(seq 1 $MAX_RETRIES); do
98+ echo "Downloading checksums file (attempt $i/$MAX_RETRIES)"
99+ if curl -fsSL -o "$DL_DIR/$FLUX_CHECKSUMS_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_CHECKSUMS_FILE"; then
100+ break
101+ fi
102+ if [ $i -lt $MAX_RETRIES ]; then
103+ echo "Download failed, retrying in ${RETRY_DELAY} seconds..."
104+ sleep $RETRY_DELAY
105+ else
106+ echo "Failed to download checksums file after $MAX_RETRIES attempts"
107+ exit 1
108+ fi
109+ done
110+
83111 echo "Verifying checksum"
84112 sum=""
85113 if command -v openssl > /dev/null; then
You can’t perform that action at this time.
0 commit comments