mirror of
https://github.com/truenas/charts.git
synced 2026-11-26 15:26:05 +00:00
52 lines
1.3 KiB
Smarty
52 lines
1.3 KiB
Smarty
{{/*
|
|
Retrieve volume configuration
|
|
|
|
This expects a dictionary in the following format:
|
|
{
|
|
"name": string,
|
|
"emptyDirVolumes": boolean,
|
|
"ixVolumes": list,
|
|
"hostPathEnabled": boolean,
|
|
"pathField": string,
|
|
"datasetName": string,
|
|
}
|
|
*/}}
|
|
{{- define "common.volumeConfig" -}}
|
|
{{- $values := . -}}
|
|
{{- include "common.validateKeys" (dict "values" $values "checkKeys" (list "name")) -}}
|
|
- name: {{ $values.name }}
|
|
{{- if $values.emptyDirVolumes -}}
|
|
emptyDir: {}
|
|
{{- else -}}
|
|
hostPath:
|
|
path: {{ template "common.configuredHostPath" $values }}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
|
|
{{/*
|
|
Retrieve configuration for volumes
|
|
|
|
This expects a dictionary to be provided in the following format:
|
|
{
|
|
"ixVolumes": list,
|
|
"volumes": [
|
|
{
|
|
"name": string,
|
|
"emptyDirVolumes": boolean,
|
|
"hostPathEnabled": boolean,
|
|
"pathField": string,
|
|
"datasetName": string,
|
|
}
|
|
] ( list of dicts )
|
|
}
|
|
*/}}
|
|
{{- define "common.volumesConfiguration" -}}
|
|
{{- $values := . -}}
|
|
{{- include "common.validateKeys" (dict "values" $values "checkKeys" (list "ixVolumes" "volumes")) -}}
|
|
{{- range $vol := $values.volumes -}}
|
|
{{- $_ := set $vol "ixVolumes" $values.ixVolumes -}}
|
|
{{- include "common.volumeConfig" $vol -}}
|
|
{{- end -}}
|
|
{{- end -}}
|