mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Added OS verification for third party etcd binary
This commit is contained in:
parent
c10e8bc4f0
commit
5357f9a7e8
@ -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}"
|
||||
|
Loading…
Reference in New Issue
Block a user