Skip to content

Commit

Permalink
chore(charts): define APIVersion template
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingdon Barrett committed Nov 2, 2019
1 parent ed8e945 commit bca00d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions charts/registry-proxy/templates/_helpers.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{/*
Set apiVersion based on .Capabilities.APIVersions
*/}}
{{- define "APIVersion" -}}
{{- if .Capabilities.APIVersions.Has "apps/v1" -}}
apps/v1
{{- else if .Capabilities.APIVersions.Has "extensions/v1beta1" -}}
extensions/v1beta1
{{- else -}}
apps/v1
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/registry-proxy/templates/registry-proxy-daemon.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if eq .Values.global.registry_location "on-cluster" }}
apiVersion: {{ .Values.global.api_group }}
apiVersion: {{ template "APIVersion" . }}
kind: DaemonSet
metadata:
name: deis-registry-proxy
Expand Down

0 comments on commit bca00d4

Please sign in to comment.