Skip to content

Commit 86bc828

Browse files
committed
feat(charts): reuses the value from an existing secret and config
1 parent 66cf5ce commit 86bc828

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

charts/passport/templates/passport-secret-creds.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ data:
1212
{{- if (.Values.databaseReplicaUrl) }}
1313
database-replica-url: {{ .Values.databaseReplicaUrl | b64enc }}
1414
{{- end }}
15-
django-secret-key: {{ randAscii 64 | b64enc }}
16-
oidc-rsa-private-key: "{{genPrivateKey "rsa" | b64enc}}"
15+
django-secret-key: {{ (include "common.secrets.lookup" (dict "secret" "passport-creds" "key" "django-secret-key" "defaultValue" (randAscii 64) "context" $)) }}
16+
oidc-rsa-private-key: {{genPrivateKey "rsa" | b64enc}}
1717
{{- range $item := .Values.initApplications }}
1818
{{- if ($item.prefix) }}
19-
drycc-passport-{{$item.name | replace " " "-" | lower}}-key: {{ if $item.key | default "" | ne "" }}{{ $item.key | b64enc }}{{ else }}{{ randAlphaNum 40 | b64enc }}{{ end }}
20-
drycc-passport-{{$item.name | replace " " "-" | lower}}-secret: {{ if $item.secret | default "" | ne "" }}{{ $item.secret | b64enc }}{{ else }}{{ randAlphaNum 64 | b64enc }}{{ end }}
19+
{{- $name := ($item.name | replace " " "-" | lower) }}
20+
drycc-passport-{{$name}}-key: {{ (include "common.secrets.lookup" (dict "secret" "passport-creds" "key" "drycc-passport-($name)-key" "defaultValue" ($item.key | default (randAlphaNum 40)) "context" $)) }}
21+
drycc-passport-{{$name}}-secret: {{ (include "common.secrets.lookup" (dict "secret" "passport-creds" "key" "drycc-passport-($name)-secret" "defaultValue" ($item.secret | default (randAlphaNum 64)) "context" $)) }}
2122
{{- end }}
2223
{{- end }}
2324
{{- end }}

0 commit comments

Comments
 (0)