Skip to content

Commit 9585f53

Browse files
committed
make deployment apiVersion dependent on k8s version
1 parent ec637ba commit 9585f53

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

deployment/helm/reactive-interaction-gateway/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ Create chart name and version as used by the chart label.
3030
{{- define "reactive-interaction-gateway.chart" -}}
3131
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
3232
{{- end -}}
33+
34+
{{/*
35+
Return the appropriate apiVersion for deployment.
36+
*/}}
37+
{{- define "deployment.apiVersion" -}}
38+
{{- if semverCompare ">=1.9-0" .Capabilities.KubeVersion.GitVersion -}}
39+
{{- print "apps/v1" -}}
40+
{{- else -}}
41+
{{- print "apps/v1beta2" -}}
42+
{{- end -}}
43+
{{- end -}}

deployment/helm/reactive-interaction-gateway/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: apps/v1
1+
apiVersion: {{ template "deployment.apiVersion" . }}
22
kind: Deployment
33
metadata:
44
name: {{ template "reactive-interaction-gateway.name" . }}

0 commit comments

Comments
 (0)