diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index fffa74c..1bcdd72 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -65,3 +65,19 @@ Create the name of the service account to use {{- end }} {{- end }} +{{/* +Return the MariaDB Secret Name +*/}} +{{- define "librebooking.databaseSecretName" -}} +{{- if .Values.mariadb.enabled }} + {{- if .Values.mariadb.auth.existingSecret -}} + {{- printf "%s" .Values.mariadb.auth.existingSecret -}} + {{- else -}} + {{- printf "%s" (include "librebooking.mariadb.fullname" .) -}} + {{- end -}} +{{- else if .Values.externalDatabase.existingSecret -}} + {{- printf "%s" .Values.externalDatabase.existingSecret -}} +{{- else -}} + {{- printf "%s-db-secrets" (include "librebooking.fullname" .) -}} +{{- end -}} +{{- end -}} \ No newline at end of file