[DCAE] Make sure to update index.yaml after pushing common chart 82/122182/3
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Thu, 24 Jun 2021 14:22:34 +0000 (16:22 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Mon, 28 Jun 2021 11:57:30 +0000 (11:57 +0000)
As helm may cache the index.yaml from the server let's force it to
update it after we push our dcae common chart to be sure that the
building process of dcae services is able to find it.

Issue-ID: OOM-1
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Change-Id: I5e88ee2652f81899a86be7e8231e81b87fb89139

kubernetes/dcaegen2-services/common/Makefile

index 4a6491d..db8704c 100644 (file)
@@ -22,11 +22,18 @@ HELM_REPO := local
 
 EXCLUDES :=
 HELM_BIN := helm
+# 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
+
 HELM_CHARTS := $(filter-out $(EXCLUDES), $(sort $(patsubst %/.,%,$(wildcard */.))))
 
 .PHONY: $(EXCLUDES) $(HELM_CHARTS)
 
-all: $(HELM_CHARTS)
+all: $(HELM_CHARTS) helm-repo-update
 
 $(HELM_CHARTS):
        @echo "\n[$@]"
@@ -50,5 +57,11 @@ clean:
        @rm -f */requirements.lock
        @rm -f *tgz */charts/*tgz
        @rm -rf $(PACKAGE_DIR)
+
+helm-repo-update:
+ifeq "$(findstring v3,$(HELM_VER))" "v3"
+       @$(HELM_BIN) repo update
+endif
+
 %:
        @: