Skip to content

Commit

Permalink
feat: Add volumeName to PersistentVolumeClaim (traefik#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
TBurda authored and terrych0u committed Oct 2, 2023
1 parent 18f4056 commit f1e5076
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions traefik/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ spec:
{{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}
{{- if .Values.persistence.volumeName }}
volumeName: {{ .Values.persistence.volumeName | quote }}
{{- end }}
{{- end -}}
20 changes: 20 additions & 0 deletions traefik/tests/pvc-config_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
suite: Persistent volume claim configuration
templates:
- pvc.yaml
tests:
- it: should have no volumeName by default
set:
persistence:
enabled: true
asserts:
- isNull:
path: spec.volumeName
- it: should have a volumeName when specified via values
set:
persistence:
enabled: true
volumeName: traefik
asserts:
- equal:
path: spec.volumeName
value: traefik
1 change: 1 addition & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ persistence:
accessMode: ReadWriteOnce
size: 128Mi
# storageClass: ""
# volumeName: ""
path: /data
annotations: {}
# subPath: "" # only mount a subpath of the Volume into the pod
Expand Down

0 comments on commit f1e5076

Please sign in to comment.