Skip to content

Commit

Permalink
Merge pull request #147 from marcopaggioro/feature/add-volume-subpaths
Browse files Browse the repository at this point in the history
Feature/add volume subPaths for PVCs
  • Loading branch information
cfis authored Feb 6, 2025
2 parents 89f0ffa + 5681a14 commit a475362
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/docker-mailserver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "14.0.0"
description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker.
name: docker-mailserver
version: 4.1.2
version: 4.1.3
sources:
- https://github.com/docker-mailserver/docker-mailserver-helm
maintainers:
Expand Down
3 changes: 3 additions & 0 deletions charts/docker-mailserver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ spec:
{{- if $persistence.enabled }}
- name: {{ $name }}
mountPath: {{ $persistence.mountPath }}
{{- if $persistence.subPath }}
subPath: {{ $persistence.subPath }}
{{- end }}
{{- end }}
{{- end }}

Expand Down
10 changes: 10 additions & 0 deletions charts/docker-mailserver/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ tests:
path: spec.template.spec.containers[0].image
value: bananas:in-pajamas

- it: should use subPath for volumes if defined
set:
persistence:
mail-data:
subPath: another-folder
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts[?(@.name=="mail-data")].subPath
value: another-folder

- it: manifest should match snapshot
asserts:
- matchSnapshot: { }
6 changes: 6 additions & 0 deletions charts/docker-mailserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,13 @@ deployment:
# volumeMounts:
# - name: extra-storage
# mountPath: /mnt/extra-storage
# subPath: another-folder

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

## Optionally specify a list of extra volumes to add
extraVolumes: []
Expand Down Expand Up @@ -327,6 +329,7 @@ persistence:
enabled: true
existingClaim: ""
mountPath: /tmp/docker-mailserver
subPath: ""
size: "1Mi"
annotations: {}
accessModes:
Expand All @@ -338,6 +341,7 @@ persistence:
mail-data:
enabled: true
existingClaim: ""
subPath: ""
size: 10Gi
mountPath: /var/mail
annotations: {}
Expand All @@ -352,6 +356,7 @@ persistence:
enabled: true
existingClaim: ""
mountPath: /var/mail-state
subPath: ""
size: "1Gi"
annotations: {}
accessModes:
Expand All @@ -364,6 +369,7 @@ persistence:
enabled: true
existingClaim: ""
mountPath: /var/log/mail
subPath: ""
size: "1Gi"
annotations: {}
accessModes:
Expand Down

0 comments on commit a475362

Please sign in to comment.