Skip to content

Commit

Permalink
fix(secret): use release name in database secret (#65)
Browse files Browse the repository at this point in the history
Signed-off-by: Thuan Vo <thvo@redhat.com>
(cherry picked from commit e06dfb2)
  • Loading branch information
tthvo authored and mergify[bot] committed May 31, 2023
1 parent 5103667 commit 5001cb5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cryostat/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Create the name of the service account to use
Get or generate a default password for credentials database
*/}}
{{- define "cryostat.databasePassword" -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace "cryostat-jmx-credentials-db") -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace (printf "%s-jmx-credentials-db" .Release.Name)) -}}
{{- if $secret -}}
{{/*
Use current password. Do not regenerate
Expand Down
2 changes: 1 addition & 1 deletion cryostat/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
- name: CRYOSTAT_JMX_CREDENTIALS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ default "cryostat-jmx-credentials-db" .Values.core.databaseSecretName }}
name: {{ default (printf "%s-jmx-credentials-db" .Release.Name) .Values.core.databaseSecretName }}
key: CRYOSTAT_JMX_CREDENTIALS_DB_PASSWORD
optional: false
ports:
Expand Down
2 changes: 1 addition & 1 deletion cryostat/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: cryostat-jmx-credentials-db
name: {{ .Release.Name }}-jmx-credentials-db
type: Opaque
data:
CRYOSTAT_JMX_CREDENTIALS_DB_PASSWORD: {{ include "cryostat.databasePassword" . }}
Expand Down

0 comments on commit 5001cb5

Please sign in to comment.