From f7cd553044350cccf40fc4dc38a93d3669c2e4c4 Mon Sep 17 00:00:00 2001 From: Osher De Paz Date: Tue, 31 Aug 2021 16:19:39 +0300 Subject: [PATCH] return a meaningful message if we hit the rate-limiter of GitHub --- hack/install_kustomize.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hack/install_kustomize.sh b/hack/install_kustomize.sh index 0b549ffb6..2af293d30 100755 --- a/hack/install_kustomize.sh +++ b/hack/install_kustomize.sh @@ -102,7 +102,14 @@ elif [[ "$OSTYPE" == darwin* ]]; then opsys=darwin fi -RELEASE_URL=$(curl -s $release_url |\ +releases=$(curl -s $release_url) + +if [[ $releases == *"API rate limit exceeded"* ]]; then + echo "Github rate-limiter failed the request. Either authenticate or wait a couple of minutes." + exit 1 +fi + +RELEASE_URL=$(echo "${releases}" |\ grep browser_download.*${opsys}_${arch} |\ cut -d '"' -f 4 |\ sort -V | tail -n 1)