change to helpers.tpl

This commit is contained in:
mrskul 2025-04-11 17:09:41 +10:00 committed by GitHub
parent 01c9b01b90
commit b5078e78d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 3 deletions

View file

@ -76,3 +76,14 @@ checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . |
configmap.reloader.stakater.com/reload: "{{ include "mail.fullname" . }}"
{{- end -}}
{{/*
Return the secret containing HTTPS/TLS certificates
*/}}
{{- define "tls.SecretName" -}}
{{- $secretName := .Values.certs.existingSecret -}}
{{- if $secretName -}}
{{- printf "%s" (tpl $secretName .) -}} # Use '.' for context, not '$'
{{- else -}}
{{- printf "%s-cert" (include "smtp-relay-mail-certs" .) -}}
{{- end -}}
{{- end -}}

View file

@ -195,7 +195,7 @@ spec:
defaultMode: 0755
- name: certs
secret:
secretName: {{ .Values.certs.name }}
secretName: {{ include "keycloak.tlsSecretName" . }}
{{- end }}
# Socket directories
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}

View file

@ -129,8 +129,8 @@ certs:
create: false
# Provide existing cert
existing: false
# Provide Cert Name
name: "smtp-relay-mail-certs"
# Provide existing secret name
existingSecret: ""
# Define data which should be stored in a Secret
# (and shared with the pod as environment variables)