@@ -74,5 +74,33 @@ run-debug: build
7474 --stderrthreshold=INFO \
7575 --kubeconfig=${KUBECONFIG} \
7676 --linodego-debug
77-
78-
77+ # Set the host's OS. Only linux and darwin supported for now
78+ HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
79+ ifeq ($(filter darwin linux,$(HOSTOS ) ) ,)
80+ $(error build only supported on linux and darwin host currently)
81+ endif
82+
83+ HELM_VERSION ?= v3.9.1
84+ TOOLS_HOST_DIR ?= .tmp/tools
85+ HELM := $(TOOLS_HOST_DIR ) /helm-$(HELM_VERSION )
86+
87+ .PHONY : $(HELM )
88+ $(HELM ) :
89+ @echo installing helm $(HELM_VERSION )
90+ @mkdir -p $(TOOLS_HOST_DIR ) /tmp-helm
91+ @curl -fsSL https://get.helm.sh/helm-$(HELM_VERSION ) -$(HOSTOS ) -amd64.tar.gz | tar -xz -C $(TOOLS_HOST_DIR ) /tmp-helm
92+ @mv $(TOOLS_HOST_DIR ) /tmp-helm/$(HOSTOS ) -amd64/helm $(HELM )
93+ @rm -fr $(TOOLS_HOST_DIR ) /tmp-helm
94+ @echo installing helm $(HELM_VERSION )
95+
96+ .PHONY : helm-lint
97+ helm-lint : $(HELM )
98+ # Verify lint works when region and apiToken are passed, and when it is passed as reference.
99+ @$(HELM) lint deploy/chart --set apiToken="apiToken",region="us-east"
100+ @$(HELM) lint deploy/chart --set secretRef.apiTokenRef="apiToken",secretRef.name="api",secretRef.regionRef="us-east"
101+
102+ .PHONY : helm-template
103+ helm-template : $(HELM )
104+ # Verify template works when region and apiToken are passed, and when it is passed as reference.
105+ @$(HELM) template foo deploy/chart --set apiToken="apiToken",region="us-east" > /dev/null
106+ @$(HELM) template foo deploy/chart --set secretRef.apiTokenRef="apiToken",secretRef.name="api",secretRef.regionRef="us-east" > /dev/null
0 commit comments