Bug fix: ./hack/install-etcd.sh is not work on Arm64 platform

Signed-off-by: Bin Lu <bin.lu@arm.com>
pull/564/head
Bin Lu 2019-01-10 17:29:49 +08:00
parent 7f0e04a089
commit 5cdb762fb9
1 changed files with 9 additions and 4 deletions

View File

@ -105,11 +105,16 @@ kube::etcd::cleanup() {
kube::etcd::install() {
(
local os
local arch
os=$(kube::util::host_os)
arch=$(kube::util::host_arch)
cd "${KUBE_ROOT}/third_party"
os=$(uname | tr "[:upper:]" "[:lower:]")
if [[ $(readlink etcd) == etcd-v${ETCD_VERSION}-${os}-* ]]; then
return # already installed
fi
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}"
@ -118,11 +123,11 @@ kube::etcd::install() {
ln -fns "etcd-v${ETCD_VERSION}-darwin-amd64" etcd
rm "${download_file}"
else
url="https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz"
download_file="etcd-v${ETCD_VERSION}-linux-amd64.tar.gz"
url="https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${arch}.tar.gz"
download_file="etcd-v${ETCD_VERSION}-linux-${arch}.tar.gz"
kube::util::download_file "${url}" "${download_file}"
tar xzf "${download_file}"
ln -fns "etcd-v${ETCD_VERSION}-linux-amd64" etcd
ln -fns "etcd-v${ETCD_VERSION}-linux-${arch}" etcd
rm "${download_file}"
fi
kube::log::info "etcd v${ETCD_VERSION} installed. To use:"