File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,19 @@ RUN go mod edit -replace=github.com/kubeflow/dashboard/components/profile-contro
1919# Force download and extract all HashiCorp modules so they exist under /go/pkg/mod
2020RUN set -e; cd /workspace; \
2121 for m in $(go list -m all | awk '/^github.com\/ hashicorp\/ / {print $1 "@" $2}' ); do \
22- go mod download "$m" ; \
22+ # download with retry (these downloads are flakey) \
23+ for i in $(seq 1 5); do \
24+ if go mod download "$m" ; then \
25+ echo "INFO: Successfully downloaded $m" ; \
26+ break; \
27+ fi; \
28+ if [ $i -eq 5 ]; then \
29+ echo "ERROR: Failed to download $m after $i attempts" ; \
30+ exit 1; \
31+ fi; \
32+ echo "WARN: Retrying download of $m (attempt $i)" ; \
33+ sleep $((i * 2)); \
34+ done; \
2335 pkg="${m%@*}" ; \
2436 go list "$pkg/..." >/dev/null 2>&1 || true; \
2537 done
Original file line number Diff line number Diff line change @@ -15,7 +15,19 @@ RUN go mod download
1515# Force download and extract all HashiCorp modules so they exist under /go/pkg/mod
1616RUN set -e; cd /workspace; \
1717 for m in $(go list -m all | awk '/^github.com\/ hashicorp\/ / {print $1 "@" $2}' ); do \
18- go mod download "$m" ; \
18+ # download with retry (these downloads are flakey) \
19+ for i in $(seq 1 5); do \
20+ if go mod download "$m" ; then \
21+ echo "INFO: Successfully downloaded $m" ; \
22+ break; \
23+ fi; \
24+ if [ $i -eq 5 ]; then \
25+ echo "ERROR: Failed to download $m after $i attempts" ; \
26+ exit 1; \
27+ fi; \
28+ echo "WARN: Retrying download of $m (attempt $i)" ; \
29+ sleep $((i * 2)); \
30+ done; \
1931 pkg="${m%@*}" ; \
2032 go list "$pkg/..." >/dev/null 2>&1 || true; \
2133 done
You can’t perform that action at this time.
0 commit comments