mirror of https://github.com/kubernetes/kops.git
Merge pull request #5795 from justinsb/no_which_way
Avoid using which, CoreOS doesn't always have it
This commit is contained in:
commit
c4bdda2f83
|
|
@ -77,19 +77,20 @@ download-or-bust() {
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -66,19 +66,20 @@ download-or-bust() {
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -66,19 +66,20 @@ download-or-bust() {
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -66,19 +66,20 @@ download-or-bust() {
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -66,19 +66,20 @@ download-or-bust() {
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -66,19 +66,20 @@ download-or-bust() {
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -66,19 +66,20 @@ download-or-bust() {
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -51,19 +51,20 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersadditionalcidrex
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
@ -327,19 +328,20 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionalcidrexamplecom.Propert
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -60,19 +60,20 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
@ -357,19 +358,20 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionaluserdataexamplecom.Pro
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -51,19 +51,20 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
@ -327,19 +328,20 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -51,19 +51,20 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersexternallbexampl
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
@ -347,19 +348,20 @@ Resources.AWSAutoScalingLaunchConfigurationnodesexternallbexamplecom.Properties.
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
|
|
@ -51,19 +51,20 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
@ -327,19 +328,20 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use
|
|||
|
||||
if [[ -e "${file}" ]]; then
|
||||
echo "== File exists for ${url} =="
|
||||
elif [[ $(which curl) ]]; then
|
||||
|
||||
# CoreOS runs this script in a container without which (but has curl)
|
||||
# Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl
|
||||
# So we default to wget unless we see curl
|
||||
elif [[ $(curl --version) ]]; then
|
||||
if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then
|
||||
echo "== Failed to curl ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
elif [[ $(which wget ) ]]; then
|
||||
else
|
||||
if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then
|
||||
echo "== Failed to wget ${url}. Retrying. =="
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "== Could not find curl or wget. Retrying. =="
|
||||
break
|
||||
fi
|
||||
|
||||
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue