Skip to content

Commit

Permalink
Base64 decode encryption key when reading it from existing secret (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Apr 24, 2024
1 parent 642b1c5 commit b615471
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions templates/secret-api-encryption.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $encryptionKey := randAlphaNum 36 | b64enc | quote }}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace "kotsadm-encryption") }}
{{- if $secret }}
{{- $encryptionKey = index $secret.data "encryptionKey" }}
{{- $encryptionKey = index $secret.data "encryptionKey" | b64dec }}
{{- end -}}
apiVersion: v1
kind: Secret
Expand All @@ -11,4 +11,3 @@ metadata:
name: kotsadm-encryption
stringData:
encryptionKey: {{ $encryptionKey }}

0 comments on commit b615471

Please sign in to comment.