Skip to content

Commit b27a790

Browse files
committed
fix server password recreation issue
1 parent 4ac1d92 commit b27a790

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

charts/edgedb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: edgedb
33
description: A Helm chart for self hosting EdgeDB
44
type: application
5-
version: 0.1.2
5+
version: 0.1.3
66
appVersion: "5.6"

charts/edgedb/templates/_helpers.tpl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ app.kubernetes.io/instance: {{ .Release.Name }}
5252

5353

5454
{{/*
55-
Get the server password value
55+
Generate or lookup password
5656
*/}}
57-
{{- define "edgedb.serverPassword" -}}
58-
{{- if .Values.security.password }}
59-
{{- .Values.security.password.secret.name }}
57+
{{- define "edgedb.password" -}}
58+
{{- $secret := lookup "v1" "Secret" .Release.Namespace (printf "%s-server-password" (include "edgedb.fullname" .)) }}
59+
{{- if $secret }}
60+
{{- index $secret.data "password" | b64dec }}
6061
{{- else }}
61-
{{- include "edgedb.fullname" . }}-server-password
62+
{{- randAlphaNum 20 }}
6263
{{- end }}
6364
{{- end }}
6465

charts/edgedb/templates/deployment.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,8 @@ spec:
8989
- name: EDGEDB_SERVER_PASSWORD
9090
valueFrom:
9191
secretKeyRef:
92-
{{- if .Values.security.password }}
93-
name: {{ .Values.security.password.secret.name }}
94-
key: {{ .Values.security.password.secret.key }}
95-
{{- else }}
9692
name: {{ include "edgedb.fullname" . }}-server-password
9793
key: password
98-
{{- end}}
9994
{{- with .Values.env }}
10095
{{- toYaml . | nindent 8 }}
10196
{{- end }}

charts/edgedb/templates/password.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ metadata:
1111
{{- include "edgedb.labels" . | nindent 4 }}
1212
type: Opaque
1313
data:
14-
password: {{ $password := randAlphaNum 20 }}{{ $password | b64enc | quote }}
14+
password: {{ $password := include "edgedb.password" . }}{{ $password | b64enc | quote }}
1515
edgedbBackendDsn: {{ printf "edgedb://edgedb:%s@%s.%s.svc.cluster.local:5656" $password (include "edgedb.fullname" .) .Release.Namespace | b64enc | quote }}
1616
{{- end }}

charts/edgedb/templates/pvc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{{- if .Values.storage.enabled }}
2+
{{- if not .Values.storage.className }}
3+
{{- fail "You must provide a storage class name" }}
4+
{{- end }}
25
apiVersion: v1
36
kind: PersistentVolumeClaim
47
metadata:

charts/edgedb/values-example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ env:
1515
value: enabled
1616
storage:
1717
enabled: true
18-
className: ""
18+
className: "local-path"
1919
storage: "10Gi"

0 commit comments

Comments
 (0)