Skip to content

Commit

Permalink
Merge pull request #36252 from ixdy/get-kube-binaries-script
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Use curl -f in cluster/get-kube.sh

**What this PR does / why we need it**:
Make `curl` explicitly fail if there are HTTP errors. This makes things more obvious than tar mysteriously failing. x-ref kubernetes/test-infra#990

(I also added -L so HTTP redirects work, in case we eventually want to use them.)
  • Loading branch information
Kubernetes Submit Queue authored Nov 5, 2016
2 parents ec6a5d2 + 7436b31 commit 4d7960b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cluster/get-kube-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function download_tarball() {
url="${DOWNLOAD_URL_PREFIX}/${file}"
mkdir -p "${download_path}"
if [[ $(which curl) ]]; then
curl -L --retry 3 --keepalive-time 2 "${url}" -o "${download_path}/${file}"
curl -fL --retry 3 --keepalive-time 2 "${url}" -o "${download_path}/${file}"
elif [[ $(which wget) ]]; then
wget "${url}" -O "${download_path}/${file}"
else
Expand Down
6 changes: 3 additions & 3 deletions cluster/get-kube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Usage:
# wget -q -O - https://get.k8s.io | bash
# or
# curl -sS https://get.k8s.io | bash
# curl -fsSL https://get.k8s.io | bash
#
# Advanced options
# Set KUBERNETES_PROVIDER to choose between different providers:
Expand Down Expand Up @@ -115,7 +115,7 @@ function get_latest_version_number {
if [[ $(which wget) ]]; then
wget -qO- "${latest_url}"
elif [[ $(which curl) ]]; then
curl -Ssf --retry 3 --keepalive-time 2 "${latest_url}"
curl -sSfL --retry 3 --keepalive-time 2 "${latest_url}"
else
echo "Couldn't find curl or wget. Bailing out." >&2
exit 4
Expand Down Expand Up @@ -203,7 +203,7 @@ fi

if "${need_download}"; then
if [[ $(which curl) ]]; then
curl -L --retry 3 --keepalive-time 2 "${release_url}" -o "${file}"
curl -fL --retry 3 --keepalive-time 2 "${release_url}" -o "${file}"
elif [[ $(which wget) ]]; then
wget "${release_url}"
else
Expand Down

0 comments on commit 4d7960b

Please sign in to comment.