Skip to content

Commit

Permalink
Merge pull request #102 from camptocamp/volumeDevices
Browse files Browse the repository at this point in the history
Add Volume Device
  • Loading branch information
sbrunner authored Mar 28, 2023
2 parents b520fba + e19f7bc commit 016c8a4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 6 additions & 2 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ spec:
{{- end }}
{{- with $config.volumeMounts }}
volumeMounts:
{{- include "common.dictToList" ( dict "keyName" "mountPath" "contents" . ) | nindent 12 -}}
{{- end -}}
{{- include "common.dictToList" ( dict "keyName" "mountPath" "contents" . ) | nindent 12 }}
{{- end }}
{{- with $config.volumeDevices }}
volumeDevices:
{{- include "common.dictToList" ( dict "keyName" "devicePath" "contents" . ) | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
containers:
Expand Down
7 changes: 7 additions & 0 deletions tests/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ spec:
name: my-volume
subPath: data

volumeDevices:
- devicePath: /dev/xvda
name: my-device-volume

containers:
- name: cc
securityContext:
Expand Down Expand Up @@ -276,6 +280,9 @@ spec:
path: /heals/startup
port: http
volumes:
- name: my-device-volume
persistentVolumeClaim:
claimName: pvc-name
- name: my-volume
emptyDir: {}
---
Expand Down
6 changes: 6 additions & 0 deletions tests/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ services:
/tmp/my-volume/data:
name: my-volume
subPath: data
volumeDevices:
/dev/xvda:
name: my-device-volume

containers:
cc:
Expand Down Expand Up @@ -107,6 +110,9 @@ services:
volumes:
my-volume:
emptyDir: {}
my-device-volume:
persistentVolumeClaim:
claimName: pvc-name

securityContext:
runAsNonRoot: true
Expand Down

0 comments on commit 016c8a4

Please sign in to comment.