Skip to content

Commit

Permalink
Dbp 000 - helm existingsecret lookup (#50)
Browse files Browse the repository at this point in the history
* refactor config.php to use externalDatabase existing secret lookup if existing secret is set, else password
  • Loading branch information
JannikBadenhop authored Sep 25, 2024
1 parent fac9899 commit 1ccafb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/dbp-moodle/scripts/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
$CFG->dbhost = '{{ .Values.moodle.externalDatabase.host }}';
$CFG->dbname = '{{ .Values.moodle.externalDatabase.database }}';
$CFG->dbuser = '{{ .Values.moodle.externalDatabase.user }}';
{{ if .Values.moodle.externalDatabase.existingSecret -}}
$CFG->dbpass = '{{ index (lookup "v1" "Secret" .Release.Namespace .Values.moodle.externalDatabase.existingSecret).data "mariadb-password" | b64dec }}';
{{- else -}}
$CFG->dbpass = '{{ .Values.moodle.externalDatabase.password }}';
{{- end }}
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
Expand Down

0 comments on commit 1ccafb2

Please sign in to comment.