From b1b6e02a198ce91b2f4ccebc4bcd038619e8d8da Mon Sep 17 00:00:00 2001 From: Noste <83548733+Noooste@users.noreply.github.com> Date: Fri, 26 Dec 2025 15:37:51 +0100 Subject: [PATCH] refactor: set jwt secret generation directly in secret.yaml Signed-off-by: Noste <83548733+Noooste@users.noreply.github.com> --- helm/garage-ui/templates/jwt.yaml | 18 ------------------ helm/garage-ui/templates/secret.yaml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 helm/garage-ui/templates/jwt.yaml diff --git a/helm/garage-ui/templates/jwt.yaml b/helm/garage-ui/templates/jwt.yaml deleted file mode 100644 index 2a25ba5..0000000 --- a/helm/garage-ui/templates/jwt.yaml +++ /dev/null @@ -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 }} \ No newline at end of file diff --git a/helm/garage-ui/templates/secret.yaml b/helm/garage-ui/templates/secret.yaml index 6d4fdae..39dc817 100644 --- a/helm/garage-ui/templates/secret.yaml +++ b/helm/garage-ui/templates/secret.yaml @@ -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 }} \ No newline at end of file