From 697a30ac44674ea7c5d678e31aa5cc9a513afe64 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Fri, 6 Dec 2019 15:09:20 +0800 Subject: [PATCH] curl retry to make it stable (#1297) --- hack/lib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/lib.sh b/hack/lib.sh index 3dcbeaeb07e..c5bde3c2454 100644 --- a/hack/lib.sh +++ b/hack/lib.sh @@ -66,7 +66,7 @@ function hack::ensure_kubectl() { echo "Installing kubectl v$KUBECTL_VERSION..." tmpfile=$(mktemp) trap "test -f $tmpfile && rm $tmpfile" RETURN - curl -Lo $tmpfile https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/${OS}/${ARCH}/kubectl + curl --retry 10 -L -o $tmpfile https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/${OS}/${ARCH}/kubectl mv $tmpfile $KUBECTL_BIN chmod +x $KUBECTL_BIN } @@ -85,7 +85,7 @@ function hack::ensure_helm() { return 0 fi local HELM_URL=http://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-${OS}-${ARCH}.tar.gz - curl -s "$HELM_URL" | tar --strip-components 1 -C $OUTPUT_BIN -zxf - ${OS}-${ARCH}/helm + curl --retry 10 -L -s "$HELM_URL" | tar --strip-components 1 -C $OUTPUT_BIN -zxf - ${OS}-${ARCH}/helm } function hack::verify_kind() { @@ -103,7 +103,7 @@ function hack::ensure_kind() { echo "Installing kind v$KIND_VERSION..." tmpfile=$(mktemp) trap "test -f $tmpfile && rm $tmpfile" RETURN - curl -Lo $tmpfile https://github.com/kubernetes-sigs/kind/releases/download/v${KIND_VERSION}/kind-$(uname)-amd64 + curl --retry 10 -L -o $tmpfile https://github.com/kubernetes-sigs/kind/releases/download/v${KIND_VERSION}/kind-$(uname)-amd64 mv $tmpfile $KIND_BIN chmod +x $KIND_BIN }