diff --git a/charts/stable/fireflyiii/Chart.yaml b/charts/stable/fireflyiii/Chart.yaml index b52a81b09df..b4b10ffe7e6 100644 --- a/charts/stable/fireflyiii/Chart.yaml +++ b/charts/stable/fireflyiii/Chart.yaml @@ -27,4 +27,4 @@ name: fireflyiii sources: - https://github.com/firefly-iii/firefly-iii/ type: application -version: 6.0.10 +version: 6.0.11 diff --git a/charts/stable/fireflyiii/templates/_secrets.tpl b/charts/stable/fireflyiii/templates/_secrets.tpl index 9877e11a15f..092b9c75ee0 100644 --- a/charts/stable/fireflyiii/templates/_secrets.tpl +++ b/charts/stable/fireflyiii/templates/_secrets.tpl @@ -7,17 +7,16 @@ kind: Secret metadata: {{- $dbcredsname := ( printf "%v-%v" .Release.Name "dbcreds" ) }} name: {{ $dbcredsname }} -{{- $previous := lookup "v1" "Secret" .Release.Namespace $dbcredsname }} -{{- $dbPass := "" }} data: -{{- if $previous }} - postgresql-password: {{ ( index $previous.data "postgresql-password" ) }} - postgresql-postgres-password: {{ ( index $previous.data "postgresql-postgres-password" ) }} -{{- else }} - {{- $dbPass = randAlphaNum 50 }} - postgresql-password: {{ $dbPass | b64enc | quote }} + {{- if .Release.IsInstall }} + postgresql-password: {{ randAlphaNum 50 | b64enc | quote }} postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }} -{{- end }} + {{ else }} + # `index` function is necessary because the property name contains a dash. + # Otherwise (...).data.db_password would have worked too. + postgresql-password: {{ index (lookup "v1" "Secret" .Release.Namespace ( $dbcredsname | quote ) ).data "postgresql-password" }} + postgresql-postgres-password: {{ index (lookup "v1" "Secret" .Release.Namespace ( $dbcredsname | quote ) ).data "postgresql-postgres-password" }} + {{ end }} url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }} postgresql_host: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }} type: Opaque diff --git a/charts/stable/vaultwarden/Chart.yaml b/charts/stable/vaultwarden/Chart.yaml index ccf299f9c6f..6148781086b 100644 --- a/charts/stable/vaultwarden/Chart.yaml +++ b/charts/stable/vaultwarden/Chart.yaml @@ -31,4 +31,4 @@ name: vaultwarden sources: - https://github.com/dani-garcia/vaultwarden type: application -version: 5.0.10 +version: 5.0.11 diff --git a/charts/stable/vaultwarden/templates/_secrets.tpl b/charts/stable/vaultwarden/templates/_secrets.tpl index 6f7aa8e2e11..4c9967f09cc 100644 --- a/charts/stable/vaultwarden/templates/_secrets.tpl +++ b/charts/stable/vaultwarden/templates/_secrets.tpl @@ -43,17 +43,16 @@ metadata: {{- include "common.labels" . | nindent 4 }} {{- $dbcredsname := ( printf "%v-%v" .Release.Name "dbcreds" ) }} name: {{ $dbcredsname }} -{{- $previous := lookup "v1" "Secret" .Release.Namespace $dbcredsname }} -{{- $dbPass := "" }} data: -{{- if $previous }} - postgresql-password: {{ ( index $previous.data "postgresql-password" ) }} - postgresql-postgres-password: {{ ( index $previous.data "postgresql-postgres-password" ) }} -{{- else }} - {{- $dbPass = randAlphaNum 50 }} - postgresql-password: {{ $dbPass | b64enc | quote }} + {{- if .Release.IsInstall }} + postgresql-password: {{ randAlphaNum 50 | b64enc | quote }} postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }} -{{- end }} + {{ else }} + # `index` function is necessary because the property name contains a dash. + # Otherwise (...).data.db_password would have worked too. + postgresql-password: {{ index (lookup "v1" "Secret" .Release.Namespace ( $dbcredsname | quote ) ).data "postgresql-password" }} + postgresql-postgres-password: {{ index (lookup "v1" "Secret" .Release.Namespace ( $dbcredsname | quote ) ).data "postgresql-postgres-password" }} + {{ end }} url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }} type: Opaque {{- end -}}