mirror of
https://github.com/truenas/charts.git
synced 2026-04-05 11:48:55 +08:00
Remove common method for volume configuration based on old format
This commit is contained in:
@@ -9,17 +9,3 @@ Retrieve host path from ix volumes based on dataset name
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Retrieve host path from ix volumes based on a key
|
||||
*/}}
|
||||
{{- define "common.storage.configuredHostPath" -}}
|
||||
{{- $values := . -}}
|
||||
{{- if $values.hostPathEnabled -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "pathField")) -}}
|
||||
{{- $values.pathField -}}
|
||||
{{- else -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "datasetName" "ixVolumes")) -}}
|
||||
{{- include "common.storage.retrieveHostPathFromiXVolume" (dict "datasetName" $values.datasetName "ixVolumes" $values.ixVolumes) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
{{/*
|
||||
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.storage.volumeConfig" -}}
|
||||
{{- $values := . -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "name")) -}}
|
||||
{{- if $values.emptyDirVolumes -}}
|
||||
- name: {{ $values.name }}
|
||||
emptyDir: {}
|
||||
{{- else -}}
|
||||
- name: {{ $values.name }}
|
||||
hostPath:
|
||||
path: {{ template "common.storage.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.storage.volumesConfiguration" -}}
|
||||
{{- $values := . -}}
|
||||
{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "ixVolumes" "volumes")) -}}
|
||||
{{- range $vol := $values.volumes -}}
|
||||
{{- $_ := set $vol "ixVolumes" $values.ixVolumes -}}
|
||||
{{- include "common.storage.volumeConfig" $vol | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user