From 9fd1ae57515385a4463e8df5e0958afc17ce033f Mon Sep 17 00:00:00 2001 From: agile6v Date: Thu, 25 Jun 2020 16:51:35 +0800 Subject: [PATCH] Add version check form helm --- build/dev-env.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/dev-env.sh b/build/dev-env.sh index f84fb4449..03a0ba608 100755 --- a/build/dev-env.sh +++ b/build/dev-env.sh @@ -45,6 +45,12 @@ if ! command -v helm &> /dev/null; then exit 1 fi +HELM_VERSION=$(helm version 2>&1 | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+') || true +if [[ ${HELM_VERSION} < "v3.0.0" ]]; then + echo "Please upgrade helm to v3.0.0 or higher" + exit 1 +fi + KUBE_CLIENT_VERSION=$(kubectl version --client --short | awk '{print $3}' | cut -d. -f2) || true if [[ ${KUBE_CLIENT_VERSION} -lt 14 ]]; then echo "Please update kubectl to 1.15 or higher"