Skip to content

Commit 2ad1e57

Browse files
committed
feat: add useImageCode flag to skip /var/www and /var/www/html volume mounts
1 parent 08deb2c commit 2ad1e57

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

charts/nextcloud/templates/_helpers.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,14 @@ Swift as primary object store env vars
368368
Create volume mounts for the nextcloud container as well as the cron sidecar container.
369369
*/}}
370370
{{- define "nextcloud.volumeMounts" -}}
371+
{{- if not .Values.nextcloud.persistence.useImageCode }}
371372
- name: nextcloud-main
372373
mountPath: /var/www/
373374
subPath: {{ ternary "root" (printf "%s/root" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
374375
- name: nextcloud-main
375376
mountPath: /var/www/html
376377
subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
378+
{{- end }}
377379
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
378380
- name: nextcloud-data
379381
mountPath: {{ .Values.nextcloud.datadir }}

charts/nextcloud/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,14 @@ spec:
207207
{{- toYaml . | nindent 12 }}
208208
{{- end }}
209209
volumeMounts:
210+
{{- if not .Values.nextcloud.persistence.useImageCode }}
210211
- name: nextcloud-main
211212
mountPath: /var/www/
212213
subPath: {{ ternary "root" (printf "%s/root" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
213214
- name: nextcloud-main
214215
mountPath: /var/www/html
215216
subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
217+
{{- end }}
216218
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
217219
- name: nextcloud-data
218220
mountPath: {{ .Values.nextcloud.datadir }}

charts/nextcloud/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ nextcloud:
141141
datadir: /var/www/html/data
142142
persistence:
143143
subPath:
144+
# Set to true when using an image with code baked in (no VOLUME /var/www/html).
145+
# Skips the /var/www/ and /var/www/html mounts so the image code is not masked
146+
# by the PVC. Only granular mounts (config, custom_apps, themes, tmp) are kept.
147+
useImageCode: false
144148
# if set, we'll template this list to the NEXTCLOUD_TRUSTED_DOMAINS env var
145149
trustedDomains: []
146150
## SMTP configuration

0 commit comments

Comments
 (0)