aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-02-22 14:06:33 +0000
committerGerrit Code Review <gerrit@onap.org>2021-02-22 14:06:33 +0000
commitee85d1d1cef081ba91c40c046fe03728aad23c5d (patch)
tree64075b613efec476943592c42c54366a2c5655cb
parent572f2249f452136d12b7cf0fdcfc4c418d5177af (diff)
parent2a4b47f9f332df8980a69f169361038f60dceb63 (diff)
Merge "[GENERAL] Fix setting of HELM_VER variable"
-rw-r--r--kubernetes/Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/kubernetes/Makefile b/kubernetes/Makefile
index 3c5254ca27..ef913e33a9 100644
--- a/kubernetes/Makefile
+++ b/kubernetes/Makefile
@@ -20,7 +20,14 @@ OUTPUT_DIR := $(ROOT_DIR)/dist
PACKAGE_DIR := $(OUTPUT_DIR)/packages
SECRET_DIR := $(OUTPUT_DIR)/secrets
HELM_BIN := helm
-HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}")
+
+# Helm v2 and helm v3 uses different version format so we first try in helm v3 format
+# and if it fails then we fallback to helm v2 one
+HELM_VER := $(shell $(HELM_BIN) version --template "{{.Version}}" 2>/dev/null)
+ifneq "$(findstring v3,$(HELM_VER))" "v3"
+ HELM_VER := $(shell $(HELM_BIN) version -c --template "{{.Client.SemVer}}")
+endif
+
# use this if you would like to push onap charts to repo with other name
# WARNING: Helm v3+ only
# WARNING: Make sure to edit also requirements files