Skip to content

Commit 9dfac3a

Browse files
author
John T Skarbek
committed
break out annotations into helper
1 parent 587767a commit 9dfac3a

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

bitnami/redis/templates/_helpers.tpl

+10
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,13 @@ redis: tls.enabled
279279
{{- define "redis.externalDNS.suffix" -}}
280280
{{ printf "%s.%s" (include "common.names.fullname" .) .Values.useExternalDNS.suffix }}
281281
{{- end -}}
282+
283+
{{/* Compile all annotations utilized for external-dns */}}
284+
{{- define "redis.externalDNS.annotations" -}}
285+
{{- if .Values.useExternalDNS.enabled }}
286+
{{ .Values.useExternalDNS.annotationKey }}hostname: {{ include "redis.externalDNS.suffix" . }}
287+
{{- range $key, $val := .Values.useExternalDNS.additionalAnnotations }}
288+
{{ $.Values.useExternalDNS.annotationKey }}{{ $key }}: {{ $val | quote }}
289+
{{- end }}
290+
{{- end }}
291+
{{- end }}

bitnami/redis/templates/headless-svc.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ metadata:
1111
{{- if .Values.commonAnnotations }}
1212
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1313
{{- end }}
14-
{{- if .Values.useExternalDNS.enabled }}
15-
{{ .Values.useExternalDNS.annotationKey }}hostname: {{ include "redis.externalDNS.suffix" . }}
16-
{{- range $key, $val := .Values.useExternalDNS.additionalAnnotations }}
17-
{{ $.Values.useExternalDNS.annotationKey }}{{ $key }}: {{ $val | quote }}
18-
{{- end }}
19-
{{- end }}
14+
{{- include "redis.externalDNS.annotations" . | nindent 4 }}
2015
spec:
2116
type: ClusterIP
2217
clusterIP: None

0 commit comments

Comments
 (0)