diff options
author | Alex <alex@adnab.me> | 2022-10-02 16:40:54 +0200 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-10-02 16:40:54 +0200 |
commit | e21b672c96da3c6d01a5ef964aa0ad7a38f8e74c (patch) | |
tree | 3c81b18ce35f168f7fe2b625340d484cf5037a9f /script/helm/garage/templates/secret.yaml | |
parent | b17d59cfabbe92c509f4888cae83f6053a8cab1e (diff) | |
parent | db0c8b3980c5cb056c9402332dd09a1bfb276997 (diff) | |
download | garage-e21b672c96da3c6d01a5ef964aa0ad7a38f8e74c.tar.gz garage-e21b672c96da3c6d01a5ef964aa0ad7a38f8e74c.zip |
Merge pull request 'Add helm chart' (#331) from chemicstry/garage:helm_chart into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/331
Reviewed-by: maximilien <me@mricher.fr>
Diffstat (limited to 'script/helm/garage/templates/secret.yaml')
-rw-r--r-- | script/helm/garage/templates/secret.yaml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/script/helm/garage/templates/secret.yaml b/script/helm/garage/templates/secret.yaml new file mode 100644 index 00000000..54749424 --- /dev/null +++ b/script/helm/garage/templates/secret.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "garage.rpcSecretName" . }} + labels: + {{- include "garage.labels" . | nindent 4 }} +type: Opaque +data: + {{/* retrieve the secret data using lookup function and when not exists, return an empty dictionary / map as result */}} + {{- $prevSecret := (lookup "v1" "Secret" .Release.Namespace (include "garage.rpcSecretName" .)) | default dict }} + {{- $prevSecretData := $prevSecret.data | default dict }} + {{- $prevRpcSecret := $prevSecretData.rpcSecret | default "" | b64dec }} + {{/* Priority is: 1. from values, 2. previous value, 3. generate random */}} + rpcSecret: {{ .Values.garage.rpcSecret | default $prevRpcSecret | default (include "jupyterhub.randHex" 64) | b64enc | quote }} |