Use helm push plugin

Change-Id: Ic0df69cdf5be0eaef749b784e59daec0c8ffff63
Signed-off-by: Jakub Latusek <j.latusek@samsung.com>
Issue-ID: OOM-2562
diff --git a/kubernetes/Makefile b/kubernetes/Makefile
index b25381f..dfad45f 100644
--- a/kubernetes/Makefile
+++ b/kubernetes/Makefile
@@ -19,6 +19,7 @@
 OUTPUT_DIR := $(ROOT_DIR)/dist
 PACKAGE_DIR := $(OUTPUT_DIR)/packages
 SECRET_DIR := $(OUTPUT_DIR)/secrets
+HELM_VER := $(shell helm version --template "{{.Version}}")
 
 ifneq ($(SKIP_LINT),TRUE)
 	HELM_LINT_CMD := helm lint
@@ -65,7 +66,12 @@
 
 package-%: lint-%
 	@mkdir -p $(PACKAGE_DIR)
+ifeq "$(findstring v3,$(HELM_VER))" "v3"
+	@if [ -f $*/Chart.yaml ]; then PACKAGE_NAME=$$(helm package -d $(PACKAGE_DIR) $* | cut -d":" -f2) && helm push -f $$PACKAGE_NAME local; fi
+else
 	@if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi
+endif
+
 	@helm repo index $(PACKAGE_DIR)
 
 clean: