Skip to content

Commit

Permalink
Fix subPath on datadir mounts (fixes nextcloud#531)
Browse files Browse the repository at this point in the history
- subPath now does not necessarily end on /data, in particular empty
  subPath possible for datadir on specific PVC
- datadir persistence now does not depend on overall persistence anymore
- bump .minor because old installs will need to add `/data` back to the
  subPath in the values file

Signed-off-by: Marcel Wunderlich <[email protected]>
  • Loading branch information
Deaddy committed Feb 22, 2024
1 parent 9d560de commit a2dac2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 4.6.2
version: 4.7.0
appVersion: 28.0.2
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
8 changes: 5 additions & 3 deletions charts/nextcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,13 @@ Create volume mounts for the nextcloud container as well as the cron sidecar con
- name: nextcloud-main
mountPath: /var/www/html
subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
{{- if .Values.persistence.nextcloudData.enabled }}
- name: nextcloud-data
mountPath: {{ .Values.nextcloud.datadir }}
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.nextcloudData.subPath) (empty .Values.persistence.nextcloudData.subPath) }}
{{- else }}
{{- if not (empty .Values.persistence.nextcloudData.subPath) }}
subPath: {{ .Values.persistence.nextcloudData.subPath }}
{{- end }}
{{- else if .Values.persistence.enabled }}
- name: nextcloud-main
mountPath: {{ .Values.nextcloud.datadir }}
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.subPath) (empty .Values.persistence.subPath) }}
Expand Down
8 changes: 5 additions & 3 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ spec:
- name: nextcloud-main
mountPath: /var/www/html
subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
{{- if .Values.persistence.nextcloudData.enabled }}
- name: nextcloud-data
mountPath: {{ .Values.nextcloud.datadir }}
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.nextcloudData.subPath) (empty .Values.persistence.nextcloudData.subPath) }}
{{- else }}
{{- if not (empty .Values.persistence.nextcloudData.subPath) }}
subPath: {{ .Values.persistence.nextcloudData.subPath }}
{{- end }}
{{- else if .Values.persistence.enabled }}
- name: nextcloud-main
mountPath: {{ .Values.nextcloud.datadir }}
subPath: {{ ternary "data" (printf "%s/data" .Values.persistence.subPath) (empty .Values.persistence.subPath) }}
Expand Down

0 comments on commit a2dac2f

Please sign in to comment.