diff --git a/mailu/templates/_database.tpl b/mailu/templates/_database.tpl index d029779b..78f5232e 100644 --- a/mailu/templates/_database.tpl +++ b/mailu/templates/_database.tpl @@ -71,6 +71,17 @@ {{- end -}} {{- end -}} +{{/* Return the database URI appendix for Mailu */}} +{{- define "mailu.database.appendix" -}} +{{- if .Values.mariadb.enabled -}} + {{- "" | quote }} +{{- else if .Values.postgresql.enabled -}} + {{- "" | quote }} +{{- else }} + {{- .Values.externalDatabase.appendix | quote }} +{{- end -}} +{{- end -}} + {{/* Return the name of the secret for the external database */}} {{- define "mailu.database.external.secretName" -}} {{ include "common.secrets.name" (dict "existingSecret" .Values.externalDatabase.existingSecret "defaultNameSuffix" "externaldb" "context" .) }}