Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(secret): use release name in database secret #65

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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