Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Adding ability to use additional fields for volume mounts #97

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ spec:
mountPath: "/benthos.yaml"
subPath: "benthos.yaml"
readOnly: true
{{- range .Values.extraVolumeMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
readOnly: {{ .readOnly }}
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- if and .Values.streams.enabled .Values.streams.streamsConfigMap }}
- name: streams
Expand Down
47 changes: 47 additions & 0 deletions tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,50 @@ tests:
- configMap:
name: my-config-map
name: streams

- it: should allow custom volume mounts
set:
deployment:
rolloutConfigMap: false
streams:
enabled: true
api:
enable: false
streamsConfigMap: "my-config-map"
extraVolumeMounts:
- mountPath: /testing
name: test
readOnly: true
subPath: testPath
asserts:
- equal:
path: spec.template.spec.containers[0].args
value:
- -c
- /benthos.yaml
- streams
- --no-api
- /streams/*.yaml
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- mountPath: /benthos.yaml
name: config
readOnly: true
subPath: benthos.yaml
- mountPath: /testing
name: test
readOnly: true
subPath: testPath
- mountPath: /streams
name: streams
readOnly: true
- equal:
path: spec.template.spec.volumes
value:
- configMap:
name: RELEASE-NAME-benthos-config
name: config
- configMap:
name: my-config-map
name: streams