Skip to content

Commit 38187b3

Browse files
authored
Merge pull request #402 from aramase/csidriver
feat: csidriver object api version v1
2 parents 5fd00e4 + b5e1c94 commit 38187b3

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ test-style: setup
6161
@echo "==> Running static validations and linters <=="
6262
# Setting timeout to 5m as deafult is 1m
6363
golangci-lint run --timeout=5m
64+
# Run helm lint tests
65+
helm lint --strict charts/secrets-store-csi-driver
66+
helm lint --strict manifest_staging/charts/secrets-store-csi-driver
67+
6468
sanity-test:
6569
go test -v ./test/sanity
6670
build: setup
@@ -76,6 +80,7 @@ clean:
7680
setup: clean
7781
@echo "Setup..."
7882
$Q go env
83+
$(MAKE) install-helm
7984

8085
ifndef HAS_GOLANGCI
8186
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.30.0
@@ -132,7 +137,7 @@ endif
132137

133138
.PHONY: install-helm
134139
install-helm:
135-
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
140+
helm version --short | grep -q v3 || (curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash)
136141

137142
.PHONY: e2e-teardown
138143
e2e-teardown:

manifest_staging/charts/secrets-store-csi-driver/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@ labels:
3232
app: {{ template "sscd.name" . }}
3333
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
3434
{{- end -}}
35+
36+
{{/*
37+
Return the appropriate apiVersion for CSIDriver.
38+
*/}}
39+
{{- define "csidriver.apiVersion" -}}
40+
{{- if semverCompare ">=1.18-0" .Capabilities.KubeVersion.Version }}
41+
{{- print "storage.k8s.io/v1" -}}
42+
{{- else -}}
43+
{{- print "storage.k8s.io/v1beta1" -}}
44+
{{- end -}}
45+
{{- end -}}

manifest_staging/charts/secrets-store-csi-driver/templates/csidriver.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: storage.k8s.io/v1beta1
1+
apiVersion: {{ template "csidriver.apiVersion" . }}
22
kind: CSIDriver
33
metadata:
44
name: secrets-store.csi.k8s.io

0 commit comments

Comments
 (0)