no point to try tpl on persistence item name

This commit is contained in:
Stavros kois
2022-12-06 18:18:54 +02:00
parent a975d61b7e
commit 4f8b614d19
7 changed files with 7 additions and 7 deletions

View File

@@ -5,6 +5,6 @@
{{- if not $vol.volumeSpec -}}
{{- fail (printf "You have defined custom persistence type but no <volumeSpec> was given on item (%s)" $index) -}}
{{- end }}
- name: {{ tpl (toString $index) $root }}
- name: {{ $index }}
{{- tpl ( toYaml $vol.volumeSpec ) $root | nindent 2 -}}
{{- end -}}

View File

@@ -2,7 +2,7 @@
{{- $index := .index -}}
{{- $vol := .volume -}}
{{- $root := .root }}
- name: {{ tpl (toString $index) $root }}
- name: {{ $index }}
{{- if not (or $vol.medium $vol.sizeLimit) }}
emptyDir: {}
{{- else }}

View File

@@ -2,7 +2,7 @@
{{- $index := .index -}}
{{- $vol := .volume -}}
{{- $root := .root }}
- name: {{ tpl (toString $index) $root }}
- name: {{ $index }}
hostPath:
path: {{ required (printf "hostPath not set on item %s" $index) $vol.hostPath }}
{{- with $vol.hostPathType }}

View File

@@ -2,6 +2,6 @@
{{- $index := .index -}}
{{- $vol := .volume -}}
{{- $root := .root }}
- name: {{ tpl (toString $index) $root }}
- name: {{ $index }}
{{- end -}}

View File

@@ -2,7 +2,7 @@
{{- $index := .index -}}
{{- $vol := .volume -}}
{{- $root := .root }}
- name: {{ tpl (toString $index) $root }}
- name: {{ $index }}
nfs:
server: {{ required (printf "NFS Server not set on item %s" $index) $vol.server }}
path: {{ required (printf "NFS Path not set on item %s" $index) $vol.path }}

View File

@@ -17,7 +17,7 @@
{{- $pvcName = . -}}
{{- end -}}
{{- end }}
- name: {{ tpl (toString $index) $root }}
- name: {{ $index }}
persistentVolumeClaim:
claimName: {{ tpl $pvcName $root }}
{{- end -}}

View File

@@ -3,7 +3,7 @@
{{- $vol := .volume -}}
{{- $root := .root -}}
{{- $objectName := tpl (required (printf "objectName not set for persistence item %s" (toString $index)) $vol.objectName) $root }}
- name: {{ tpl (toString $index) $root }}
- name: {{ $index }}
secret:
secretName: {{ $objectName }}
{{- with $vol.defaultMode }}