diff --git a/hack/lib/etcd.sh b/hack/lib/etcd.sh index 3719dbf67ba..1aacae6cfec 100755 --- a/hack/lib/etcd.sh +++ b/hack/lib/etcd.sh @@ -102,11 +102,13 @@ kube::etcd::cleanup() { kube::etcd::install() { ( + local os cd "${KUBE_ROOT}/third_party" - if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-* ]]; then + os=$(uname | tr "[:upper:]" "[:lower:]") + if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-${os}-* ]]; then return # already installed fi - if [[ $(uname) == "Darwin" ]]; then + if [[ ${os} == "darwin" ]]; then download_file="etcd-v${ETCD_VERSION}-darwin-amd64.zip" url="https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/${download_file}" kube::util::download_file "${url}" "${download_file}" @@ -119,6 +121,7 @@ kube::etcd::install() { kube::util::download_file "${url}" "${download_file}" tar xzf "${download_file}" ln -fns "etcd-v${ETCD_VERSION}-linux-amd64" etcd + rm "${download_file}" fi kube::log::info "etcd v${ETCD_VERSION} installed. To use:" kube::log::info "export PATH=$(pwd)/etcd:\${PATH}"