Skip to content

Commit 1b41758

Browse files
authored
fix: honor .global.postgresql.auth values (#154)
Signed-off-by: Tomas Coufal <tcoufal@redhat.com>
1 parent 58edf6e commit 1b41758

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

charts/backstage/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ sources:
3838
# This is the chart version. This version number should be incremented each time you make changes
3939
# to the chart and its templates, including the app version.
4040
# Versions are expected to follow Semantic Versioning (https://semver.org/)
41-
version: 1.8.0
41+
version: 1.8.1

charts/backstage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Backstage Helm Chart
33

44
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/backstage)](https://artifacthub.io/packages/search?repo=backstage)
5-
![Version: 1.8.0](https://img.shields.io/badge/Version-1.8.0-informational?style=flat-square)
5+
![Version: 1.8.1](https://img.shields.io/badge/Version-1.8.1-informational?style=flat-square)
66
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
77

88
A Helm chart for deploying a Backstage application

charts/backstage/templates/_helpers.tpl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ Return the Postgres Database hostname
4646
Return the Postgres Database Secret Name
4747
*/}}
4848
{{- define "backstage.postgresql.databaseSecretName" -}}
49-
{{- if .Values.postgresql.auth.existingSecret }}
49+
{{- if ((((.Values).global).postgresql).auth).existingSecret }}
50+
{{- tpl .Values.global.postgresql.auth.existingSecret $ -}}
51+
{{- else if .Values.postgresql.auth.existingSecret }}
5052
{{- tpl .Values.postgresql.auth.existingSecret $ -}}
5153
{{- else -}}
5254
{{- default (include "backstage.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}}
@@ -57,9 +59,16 @@ Return the Postgres Database Secret Name
5759
Return the Postgres databaseSecret key to retrieve credentials for database
5860
*/}}
5961
{{- define "backstage.postgresql.databaseSecretKey" -}}
60-
{{- if .Values.postgresql.auth.existingSecret -}}
61-
{{- .Values.postgresql.auth.secretKeys.userPasswordKey -}}
62+
{{- $defaultDatabaseSecretKey := "password" -}}
63+
{{- if (or ((((.Values).global).postgresql).auth).existingSecret .Values.postgresql.auth.existingSecret) }}
64+
{{- if (((((.Values).global).postgresql).auth).secretKeys).userPasswordKey -}}
65+
{{- .Values.global.postgresql.auth.secretKeys.userPasswordKey -}}
66+
{{- else if ((((.Values).postgresql).auth).secretKeys).userPasswordKey -}}
67+
{{- .Values.postgresql.auth.secretKeys.userPasswordKey -}}
68+
{{- else -}}
69+
{{- print $defaultDatabaseSecretKey -}}
70+
{{- end -}}
6271
{{- else -}}
63-
{{- print "password" -}}
72+
{{- print $defaultDatabaseSecretKey -}}
6473
{{- end -}}
6574
{{- end -}}

0 commit comments

Comments
 (0)