mirror of
https://github.com/Noooste/garage-ui.git
synced 2026-07-26 15:58:13 +00:00
refactor: set jwt secret generation directly in secret.yaml
Signed-off-by: Noste <83548733+Noooste@users.noreply.github.com>
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
{{- if not .Values.config.auth.jwt_private_key_secret.name }}
|
||||
{{- $secretName := printf "%s-jwt-key" (include "garage-ui.fullname" .) }}
|
||||
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace $secretName }}
|
||||
{{- if not $existingSecret }}
|
||||
{{- $privateKey := genPrivateKey "ed25519" }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $secretName }}
|
||||
labels:
|
||||
{{- include "garage-ui.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/resource-policy": keep
|
||||
type: Opaque
|
||||
data:
|
||||
jwt-key.pem: {{ $privateKey | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -51,3 +51,22 @@ type: Opaque
|
||||
data:
|
||||
jwt-key.pem: {{ .Values.config.auth.jwt_private_key | b64enc | quote }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- if not .Values.config.auth.jwt_private_key_secret.name }}
|
||||
{{- $secretName := printf "%s-jwt-key" (include "garage-ui.fullname" .) }}
|
||||
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace $secretName }}
|
||||
{{- if not $existingSecret }}
|
||||
{{- $privateKey := genPrivateKey "ed25519" }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $secretName }}
|
||||
labels:
|
||||
{{- include "garage-ui.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/resource-policy": keep
|
||||
type: Opaque
|
||||
data:
|
||||
jwt-key.pem: {{ $privateKey | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user