Commit 0f94aead authored by Davanum Srinivas's avatar Davanum Srinivas

Get install-etcd.sh to work on OSX

Check the platform before we download the etcd binary. On OSX, save the zip file, unzip it and link the directory with the correct name. Fixes 26041
parent 51e30841
...@@ -68,8 +68,16 @@ kube::etcd::cleanup() { ...@@ -68,8 +68,16 @@ kube::etcd::cleanup() {
kube::etcd::install() { kube::etcd::install() {
( (
cd "${KUBE_ROOT}/third_party" cd "${KUBE_ROOT}/third_party"
curl -fsSL --retry 3 https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz | tar xzf - if [[ $(uname) == "Darwin" ]]; then
ln -fns "etcd-v${ETCD_VERSION}-linux-amd64" etcd download_file="etcd-v${ETCD_VERSION}-darwin-amd64.zip"
curl -fsSLO --retry 3 https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/"${download_file}"
unzip -o "${download_file}"
ln -fns "etcd-v${ETCD_VERSION}-darwin-amd64" etcd
rm "${download_file}"
else
curl -fsSL --retry 3 https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz | tar xzf -
ln -fns "etcd-v${ETCD_VERSION}-linux-amd64" etcd
fi
kube::log::info "etcd v${ETCD_VERSION} installed. To use:" kube::log::info "etcd v${ETCD_VERSION} installed. To use:"
kube::log::info "export PATH=\${PATH}:$(pwd)/etcd" kube::log::info "export PATH=\${PATH}:$(pwd)/etcd"
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment