Skip to content

Commit

Permalink
fix: use existing secret
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Apr 22, 2024
1 parent 384967c commit 5b88302
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion chart/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
{{- $kratosSecret := ((lookup "v1" "Secret" .Release.Namespace (include "kratos-im.secretname" .)).data | default dict) -}}
{{- $kratosDSN := (print "postgres://" $user ":" $password "@" $host "/" $database) -}}

## Admin Password
{{- $adminPasswordSecretInj := ( lookup "v1" "Secret" .Release.Namespace "mission-control-password" ) | default dict}}
{{- $adminpasswordSecretInjData := ( get $adminPasswordSecretInj "data" ) | default dict }}

{{- $adminPasswordSecret := ( lookup "v1" "Secret" .Release.Namespace .Values.adminPassword.secretKeyRef.name ) | default dict}}
{{- $adminpasswordSecretData := ( get $adminPasswordSecret "data" ) | default dict }}

{{- $adminPassword := (( get $adminpasswordSecretInjData "password") | b64dec ) | default (( get $adminpasswordSecretData "password") | b64dec ) | default ( randAlphaNum 12 ) }}
###

{{- if .Values.db.create }}
---
apiVersion: v1
Expand All @@ -54,7 +64,7 @@ metadata:
name: {{ .Values.adminPassword.secretKeyRef.name }}
type: Opaque
stringData:
password: {{ randAlphaNum 12 }}
password: {{$adminPassword | quote}}
{{- end}}

{{- if eq .Values.authProvider "kratos" }}
Expand Down

0 comments on commit 5b88302

Please sign in to comment.