Skip to content

Commit

Permalink
[kimai2] support mariadb.auth.existingSecret
Browse files Browse the repository at this point in the history
possible fix robjuz#69
  • Loading branch information
linuxmaniac committed Oct 24, 2023
1 parent a071ae6 commit 2565bef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion charts/kimai2/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ Return the MariaDB Password
*/}}
{{- define "kimai.databasePassword" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" .Values.mariadb.auth.password -}}
{{- if .Values.mariadb.existingSecret }}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (include "mariadb.secretName" .)).data -}}
{{- if hasKey $secret "mariadb-password" }}
{{- printf "%s" (get $secret "mariadb-password") -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.mariadb.auth.password -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.password -}}
{{- end -}}
Expand Down
3 changes: 3 additions & 0 deletions charts/kimai2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,9 @@ mariadb:
database: kimai
username: kimai
password: kimai
## @param mariadb.auth.existingSecret Use existing secret for password details (`mariadb.auth.rootPassword`, `mariadb.auth.password` will be ignored and picked up from this secret).
## The secret has to contain the keys `mariadb-root-password` and `mariadb-password`
existingSecret: ""
## MariaDB Primary configuration
##
primary:
Expand Down

0 comments on commit 2565bef

Please sign in to comment.