Skip to content

Commit 163a31c

Browse files
authored
fix: allow slashes in persistence configuration section names (mount subdirectories - eg. onlyoffice dist) (#34) #35
1 parent 4db0543 commit 163a31c

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

charts/cryptpad/templates/cryptpad.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ spec:
136136
volumeMounts:
137137
{{- if .Values.persistence.enabled }}
138138
{{- range $dir, $dirvalues := .Values.persistence.cryptpad }}
139-
- name: cryptpad-{{ $dir }}
139+
- name: cryptpad-{{ $dir | replace "/" "-" }}
140140
mountPath: /cryptpad/{{ $dir }}
141141
{{- if $dirvalues.existingClaim }}
142142
persistentVolumeClaim:
@@ -145,7 +145,7 @@ spec:
145145
{{- end }}
146146
{{- else if not .Values.workloadStateful }}
147147
{{- range $dir, $dirvalues := .Values.persistence.cryptpad }}
148-
- name: cryptpad-{{ $dir }}
148+
- name: cryptpad-{{ $dir | replace "/" "-" }}
149149
mountPath: /cryptpad/{{ $dir }}
150150
{{- end }}
151151
{{- end }}
@@ -174,16 +174,16 @@ spec:
174174
{{- if and .Values.persistence.enabled .Values.workloadStateful }}
175175
{{- range $dir, $dirvalues := .Values.persistence.cryptpad }}
176176
{{- if $dirvalues.existingClaim }}
177-
- name: cryptpad-{{ $dir }}
177+
- name: cryptpad-{{ $dir | replace "/" "-" }}
178178
persistentVolumeClaim:
179-
claimName: cryptpad-{{ $dir }}
179+
claimName: cryptpad-{{ $dir | replace "/" "-" }}
180180
{{- end }}
181181
{{- end }}
182182
volumeClaimTemplates:
183183
{{- range $dir, $dirvalues := .Values.persistence.cryptpad }}
184184
{{- if not $dirvalues.existingClaim }}
185185
- metadata:
186-
name: cryptpad-{{ $dir }}
186+
name: cryptpad-{{ $dir | replace "/" "-" }}
187187
{{- with $dirvalues.annotations }}
188188
annotations:
189189
{{- toYaml . | nindent 10 }}
@@ -215,13 +215,13 @@ spec:
215215
{{- end }}
216216
{{- else if .Values.persistence.enabled }}
217217
{{- range $dir, $dirvalues := .Values.persistence.cryptpad }}
218-
- name: cryptpad-{{ $dir }}
218+
- name: cryptpad-{{ $dir | replace "/" "-" }}
219219
persistentVolumeClaim:
220-
claimName: cryptpad-{{ $dir }}
220+
claimName: cryptpad-{{ $dir | replace "/" "-" }}
221221
{{- end }}
222222
{{- else }}
223223
{{- range $dir, $dirvalues := .Values.persistence.cryptpad }}
224-
- name: cryptpad-{{ $dir }}
224+
- name: cryptpad-{{ $dir | replace "/" "-" }}
225225
emptyDir: {}
226226
{{- end }}
227227
{{- end }}

charts/cryptpad/templates/pvc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
apiVersion: v1
44
kind: PersistentVolumeClaim
55
metadata:
6-
name: cryptpad-{{ $dir }}
6+
name: cryptpad-{{ $dir | replace "/" "-" }}
77
{{- with $dirvalues.annotations }}
88
annotations:
99
{{- toYaml . | nindent 10 }}
@@ -32,4 +32,4 @@ spec:
3232
{{- toYaml . | nindent 10 }}
3333
{{- end }}
3434
{{- end }}
35-
{{- end }}
35+
{{- end }}

0 commit comments

Comments
 (0)