aboutsummaryrefslogtreecommitdiff
path: root/script/helm/garage/templates/secret.yaml
diff options
context:
space:
mode:
authorMendes <mendes.oulamara@pm.me>2022-10-04 18:14:49 +0200
committerMendes <mendes.oulamara@pm.me>2022-10-04 18:14:49 +0200
commit829f815a897b04986559910bbcbf53625adcdf20 (patch)
tree6db3c27cff2aded754a641d1f2b05c83be701267 /script/helm/garage/templates/secret.yaml
parent99f96b9564c9c841dc6c56f1255a6e70ff884d46 (diff)
parenta096ced35562bd0a8877a1ee2f755be1edafe343 (diff)
downloadgarage-829f815a897b04986559910bbcbf53625adcdf20.tar.gz
garage-829f815a897b04986559910bbcbf53625adcdf20.zip
Merge remote-tracking branch 'origin/main' into optimal-layout
Diffstat (limited to 'script/helm/garage/templates/secret.yaml')
-rw-r--r--script/helm/garage/templates/secret.yaml14
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 }}