Add method to retrieve single volume configuration based on input

This commit is contained in:
Waqar Ahmed
2021-01-28 23:42:03 +05:00
parent cea74cc63f
commit 399f867f26

View File

@@ -0,0 +1,17 @@
{{/*
Retrieve volume configuration
*/}}
{{- define "common.volumeConfig" -}}
{{- $values := . -}}
{{- if hasKey $values "name" }}
- name: {{ $values.name }}
{{- if $values.emptyDirVolumes -}}
emptyDir: {}
{{- else -}}
hostPath:
path: {{ template "common.configuredHostPath" $values }}
{{- end -}}
{{- else -}}
{{- fail "Name must be specified for Volume Configuration" -}}
{{- end -}}
{{- end -}}