Skip to content

Commit 0ec8e0d

Browse files
mujacoreydaleyrm3lFortune-Ndlovu
committed
fix(values): consistent usage of postgresql.adminPasswordKey (#44)
* fix(values): consistent usage of postgresql.adminPasswordKey * fix(backstage): consistent usage of postgresql.adminPasswordKey Replace hard-coded `postgres-password` key in POSTGRESQL_ADMIN_PASSWORD env vars with the new `rhdh.postgresql.adminPasswordKey` helper, so overriding `upstream.postgresql.auth.secretKeys.adminPasswordKey` is consistently respected by both the Backstage and PostgreSQL containers. --------- Co-authored-by: Corey Daley <cdaley@redhat.com> Co-authored-by: Armel Soro <armel@rm3l.org> Co-authored-by: Armel Soro <asoro@redhat.com> Co-authored-by: Fortune Ndlovu <fndlovu@redhat.com>
1 parent 5edb82d commit 0ec8e0d

5 files changed

Lines changed: 21 additions & 6 deletions

File tree

charts/backstage/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ sources: []
4747
# Versions are expected to follow Semantic Versioning (https://semver.org/)
4848
# Note that when this chart is published to https://github.com/openshift-helm-charts/charts
4949
# it will follow the RHDH versioning 1.y.z
50-
version: 5.12.1
50+
version: 5.12.2

charts/backstage/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# RHDH Backstage Helm Chart for OpenShift
33

4-
![Version: 5.12.1](https://img.shields.io/badge/Version-5.12.1-informational?style=flat-square)
4+
![Version: 5.12.2](https://img.shields.io/badge/Version-5.12.2-informational?style=flat-square)
55
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
66

77
A Helm chart for deploying Red Hat Developer Hub, which is a Red Hat supported version of Backstage.
@@ -29,7 +29,7 @@ For the **Generally Available** version of this chart, see:
2929
helm repo add bitnami https://charts.bitnami.com/bitnami
3030
helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart
3131

32-
helm install my-backstage redhat-developer/backstage --version 5.12.1
32+
helm install my-backstage redhat-developer/backstage --version 5.12.2
3333
```
3434

3535
## Introduction

charts/backstage/templates/_helpers.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ Sets the secretKeyRef name for Backstage to the PostgreSQL existing secret if it
3535
{{- end -}}
3636
{{- end -}}
3737

38+
{{/*
39+
Returns the PostgreSQL admin password key, supporting both global and local configurations.
40+
*/}}
41+
{{- define "rhdh.postgresql.adminPasswordKey" -}}
42+
{{- if ((((((.Values).global).postgresql).auth).secretKeys).adminPasswordKey) -}}
43+
{{- .Values.global.postgresql.auth.secretKeys.adminPasswordKey -}}
44+
{{- else if (((((.Values).postgresql).auth).secretKeys).adminPasswordKey) -}}
45+
{{- .Values.postgresql.auth.secretKeys.adminPasswordKey -}}
46+
{{- else if ((((.Values).auth).secretKeys).adminPasswordKey) -}}
47+
{{- .Values.auth.secretKeys.adminPasswordKey -}}
48+
{{- else -}}
49+
postgres-password
50+
{{- end -}}
51+
{{- end -}}
52+
3853
{{/*
3954
Get the password secret.
4055
Referenced from: https://github.com/bitnami/charts/blob/main/bitnami/postgresql/templates/_helpers.tpl#L94-L105

charts/backstage/values.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3005,7 +3005,7 @@
30053005
"name": "POSTGRESQL_ADMIN_PASSWORD",
30063006
"valueFrom": {
30073007
"secretKeyRef": {
3008-
"key": "postgres-password",
3008+
"key": "{{- include \"rhdh.postgresql.adminPasswordKey\" . }}",
30093009
"name": "{{- include \"rhdh.postgresql.secretName\" . }}"
30103010
}
30113011
}

charts/backstage/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ upstream:
286286
- name: POSTGRESQL_ADMIN_PASSWORD
287287
valueFrom:
288288
secretKeyRef:
289-
key: postgres-password
289+
key: '{{- include "rhdh.postgresql.adminPasswordKey" . }}'
290290
name: '{{- include "rhdh.postgresql.secretName" . }}'
291291
args:
292292
# This additional `app-config`` file is generated by the initContainer below, and contains the merged configuration of installed dynamic plugins.
@@ -445,7 +445,7 @@ upstream:
445445
- name: POSTGRESQL_ADMIN_PASSWORD
446446
valueFrom:
447447
secretKeyRef:
448-
key: postgres-password
448+
key: '{{- include "rhdh.postgresql.adminPasswordKey" . }}'
449449
name: '{{- include "postgresql.v1.secretName" . }}'
450450
service:
451451
extraPorts:

0 commit comments

Comments
 (0)