Fix etcd semver validation by using 'sort -V'
This commit is contained in:
parent
e58d3dbf06
commit
36d244f084
@ -36,12 +36,12 @@ kube::etcd::validate() {
|
||||
|
||||
# validate installed version is at least equal to minimum
|
||||
version=$(etcd --version | tail -n +1 | head -n 1 | cut -d " " -f 3)
|
||||
if [[ "${version}" < "${ETCD_VERSION}" ]]; then
|
||||
if [[ "`echo -e "${version}\n${ETCD_VERSION}" | sort -rV | head -n 1`" != "$version" ]]; then
|
||||
export PATH=$KUBE_ROOT/third_party/etcd:$PATH
|
||||
hash etcd
|
||||
echo $PATH
|
||||
version=$(etcd --version | head -n 1 | cut -d " " -f 3)
|
||||
if [[ "${version}" < "${ETCD_VERSION}" ]]; then
|
||||
if [[ "`echo -e "${version}\n${ETCD_VERSION}" | sort -rV | head -n 1`" != "$version" ]]; then
|
||||
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/."
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user