mirror of
https://github.com/truenas/charts.git
synced 2026-05-16 14:12:59 +08:00
Add method to retrieve single volume configuration based on input
This commit is contained in:
17
library/common/templates/lib/storage/_volume.tpl
Normal file
17
library/common/templates/lib/storage/_volume.tpl
Normal 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 -}}
|
||||
Reference in New Issue
Block a user