Skip to content

Commit 533d3a6

Browse files
author
Kingdon Barrett
committed
chore(charts): define APIVersion template
1 parent 8ffb071 commit 533d3a6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{/*
2+
Set apiVersion based on .Capabilities.APIVersions
3+
*/}}
4+
{{- define "APIVersion" -}}
5+
{{- if .Capabilities.APIVersions.Has "apps/v1" -}}
6+
apps/v1
7+
{{- else if .Capabilities.APIVersions.Has "extensions/v1beta1" -}}
8+
extensions/v1beta1
9+
{{- else -}}
10+
apps/v1
11+
{{- end -}}
12+
{{- end -}}

charts/database/templates/database-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if eq .Values.global.database_location "on-cluster" }}
2-
apiVersion: {{ .Values.global.api_group }}
2+
apiVersion: {{ template "APIVersion" . }}
33
kind: Deployment
44
metadata:
55
name: deis-database

0 commit comments

Comments
 (0)