Skip to content

Commit a475362

Browse files
authored
Merge pull request docker-mailserver#147 from marcopaggioro/feature/add-volume-subpaths
Feature/add volume subPaths for PVCs
2 parents 89f0ffa + 5681a14 commit a475362

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

charts/docker-mailserver/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: "14.0.0"
33
description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker.
44
name: docker-mailserver
5-
version: 4.1.2
5+
version: 4.1.3
66
sources:
77
- https://github.com/docker-mailserver/docker-mailserver-helm
88
maintainers:

charts/docker-mailserver/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ spec:
171171
{{- if $persistence.enabled }}
172172
- name: {{ $name }}
173173
mountPath: {{ $persistence.mountPath }}
174+
{{- if $persistence.subPath }}
175+
subPath: {{ $persistence.subPath }}
176+
{{- end }}
174177
{{- end }}
175178
{{- end }}
176179

charts/docker-mailserver/tests/deployment_test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ tests:
2121
path: spec.template.spec.containers[0].image
2222
value: bananas:in-pajamas
2323

24+
- it: should use subPath for volumes if defined
25+
set:
26+
persistence:
27+
mail-data:
28+
subPath: another-folder
29+
asserts:
30+
- equal:
31+
path: spec.template.spec.containers[0].volumeMounts[?(@.name=="mail-data")].subPath
32+
value: another-folder
33+
2434
- it: manifest should match snapshot
2535
asserts:
2636
- matchSnapshot: { }

charts/docker-mailserver/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,13 @@ deployment:
282282
# volumeMounts:
283283
# - name: extra-storage
284284
# mountPath: /mnt/extra-storage
285+
# subPath: another-folder
285286

286287
## Optionally specify a list of extra mounts to add (normally used with extraVolumes)
287288
extraVolumeMounts: []
288289
# - name: extra-storage
289290
# mountPath: /mnt/extra-storage
291+
# subPath: another-folder
290292

291293
## Optionally specify a list of extra volumes to add
292294
extraVolumes: []
@@ -327,6 +329,7 @@ persistence:
327329
enabled: true
328330
existingClaim: ""
329331
mountPath: /tmp/docker-mailserver
332+
subPath: ""
330333
size: "1Mi"
331334
annotations: {}
332335
accessModes:
@@ -338,6 +341,7 @@ persistence:
338341
mail-data:
339342
enabled: true
340343
existingClaim: ""
344+
subPath: ""
341345
size: 10Gi
342346
mountPath: /var/mail
343347
annotations: {}
@@ -352,6 +356,7 @@ persistence:
352356
enabled: true
353357
existingClaim: ""
354358
mountPath: /var/mail-state
359+
subPath: ""
355360
size: "1Gi"
356361
annotations: {}
357362
accessModes:
@@ -364,6 +369,7 @@ persistence:
364369
enabled: true
365370
existingClaim: ""
366371
mountPath: /var/log/mail
372+
subPath: ""
367373
size: "1Gi"
368374
annotations: {}
369375
accessModes:

0 commit comments

Comments
 (0)