mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Fix etcd issues on ARM
- On unstable arch like ARM, etcd needs the "ETCD_UNSUPPORTED_ARCH" to be set `# etcd --version etcd on unsupported platform without ETCD_UNSUPPORTED_ARCH=arm64 set` - `tail -n +1 | head -n 1` is unnecessary, `head -n 1` is enough.
This commit is contained in:
parent
fc573f98fb
commit
2543598628
@ -45,13 +45,20 @@ kube::etcd::validate() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# need set the env of "ETCD_UNSUPPORTED_ARCH" on unstable arch.
|
||||||
|
arch=$(uname -m)
|
||||||
|
if [[ $arch =~ aarch* ]]; then
|
||||||
|
export ETCD_UNSUPPORTED_ARCH=arm64
|
||||||
|
elif [[ $arch =~ arm* ]]; then
|
||||||
|
export ETCD_UNSUPPORTED_ARCH=arm
|
||||||
|
fi
|
||||||
# validate installed version is at least equal to minimum
|
# validate installed version is at least equal to minimum
|
||||||
version=$(etcd --version | grep Version | tail -n +1 | head -n 1 | cut -d " " -f 3)
|
version=$(etcd --version | grep Version | head -n 1 | cut -d " " -f 3)
|
||||||
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
|
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
|
||||||
export PATH=${KUBE_ROOT}/third_party/etcd:${PATH}
|
export PATH=${KUBE_ROOT}/third_party/etcd:${PATH}
|
||||||
hash etcd
|
hash etcd
|
||||||
echo "${PATH}"
|
echo "${PATH}"
|
||||||
version=$(etcd --version | head -n 1 | cut -d " " -f 3)
|
version=$(etcd --version | grep Version | head -n 1 | cut -d " " -f 3)
|
||||||
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
|
if [[ $(kube::etcd::version "${ETCD_VERSION}") -gt $(kube::etcd::version "${version}") ]]; then
|
||||||
kube::log::usage "etcd version ${ETCD_VERSION} or greater required."
|
kube::log::usage "etcd version ${ETCD_VERSION} or greater required."
|
||||||
kube::log::info "You can use 'hack/install-etcd.sh' to install a copy in third_party/."
|
kube::log::info "You can use 'hack/install-etcd.sh' to install a copy in third_party/."
|
||||||
|
Loading…
Reference in New Issue
Block a user