Skip to content

Commit 63b8633

Browse files
mujacoreydaleyrm3lFortune-Ndlovu
authored
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 3eeeefc commit 63b8633

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.13.0
50+
version: 5.13.1

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.13.0](https://img.shields.io/badge/Version-5.13.0-informational?style=flat-square)
4+
![Version: 5.13.1](https://img.shields.io/badge/Version-5.13.1-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.13.0
32+
helm install my-backstage redhat-developer/backstage --version 5.13.1
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
@@ -3097,7 +3097,7 @@
30973097
"name": "POSTGRESQL_ADMIN_PASSWORD",
30983098
"valueFrom": {
30993099
"secretKeyRef": {
3100-
"key": "postgres-password",
3100+
"key": "{{- include \"rhdh.postgresql.adminPasswordKey\" . }}",
31013101
"name": "{{- include \"rhdh.postgresql.secretName\" . }}"
31023102
}
31033103
}

charts/backstage/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ upstream:
310310
- name: POSTGRESQL_ADMIN_PASSWORD
311311
valueFrom:
312312
secretKeyRef:
313-
key: postgres-password
313+
key: '{{- include "rhdh.postgresql.adminPasswordKey" . }}'
314314
name: '{{- include "rhdh.postgresql.secretName" . }}'
315315
args:
316316
# This additional `app-config`` file is generated by the initContainer below, and contains the merged configuration of installed dynamic plugins.
@@ -469,7 +469,7 @@ upstream:
469469
- name: POSTGRESQL_ADMIN_PASSWORD
470470
valueFrom:
471471
secretKeyRef:
472-
key: postgres-password
472+
key: '{{- include "rhdh.postgresql.adminPasswordKey" . }}'
473473
name: '{{- include "postgresql.v1.secretName" . }}'
474474
service:
475475
extraPorts:

0 commit comments

Comments
 (0)