diff --git a/library/common/1.0.0/templates/lib/pod/volumes/_custom.tpl b/library/common/1.0.0/templates/lib/pod/volumes/_custom.tpl index 5ac78df4..8b839913 100644 --- a/library/common/1.0.0/templates/lib/pod/volumes/_custom.tpl +++ b/library/common/1.0.0/templates/lib/pod/volumes/_custom.tpl @@ -5,6 +5,6 @@ {{- if not $vol.volumeSpec -}} {{- fail (printf "You have defined custom persistence type but no was given on item (%s)" $index) -}} {{- end }} -- name: {{ tpl (toString $index) $root }} +- name: {{ $index }} {{- tpl ( toYaml $vol.volumeSpec ) $root | nindent 2 -}} {{- end -}} diff --git a/library/common/1.0.0/templates/lib/pod/volumes/_emptyDir.tpl b/library/common/1.0.0/templates/lib/pod/volumes/_emptyDir.tpl index dad01336..e85a4f63 100644 --- a/library/common/1.0.0/templates/lib/pod/volumes/_emptyDir.tpl +++ b/library/common/1.0.0/templates/lib/pod/volumes/_emptyDir.tpl @@ -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 }} diff --git a/library/common/1.0.0/templates/lib/pod/volumes/_hostPath.tpl b/library/common/1.0.0/templates/lib/pod/volumes/_hostPath.tpl index 3e3a4cbf..1ff219ee 100644 --- a/library/common/1.0.0/templates/lib/pod/volumes/_hostPath.tpl +++ b/library/common/1.0.0/templates/lib/pod/volumes/_hostPath.tpl @@ -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 }} diff --git a/library/common/1.0.0/templates/lib/pod/volumes/_ixVols.tpl b/library/common/1.0.0/templates/lib/pod/volumes/_ixVols.tpl index 1625e5db..46ae6fc6 100644 --- a/library/common/1.0.0/templates/lib/pod/volumes/_ixVols.tpl +++ b/library/common/1.0.0/templates/lib/pod/volumes/_ixVols.tpl @@ -2,6 +2,6 @@ {{- $index := .index -}} {{- $vol := .volume -}} {{- $root := .root }} -- name: {{ tpl (toString $index) $root }} +- name: {{ $index }} {{- end -}} diff --git a/library/common/1.0.0/templates/lib/pod/volumes/_nfs.tpl b/library/common/1.0.0/templates/lib/pod/volumes/_nfs.tpl index 11d51deb..f237cd08 100644 --- a/library/common/1.0.0/templates/lib/pod/volumes/_nfs.tpl +++ b/library/common/1.0.0/templates/lib/pod/volumes/_nfs.tpl @@ -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 }} diff --git a/library/common/1.0.0/templates/lib/pod/volumes/_pvc.tpl b/library/common/1.0.0/templates/lib/pod/volumes/_pvc.tpl index 131a06c2..3e62bcd9 100644 --- a/library/common/1.0.0/templates/lib/pod/volumes/_pvc.tpl +++ b/library/common/1.0.0/templates/lib/pod/volumes/_pvc.tpl @@ -17,7 +17,7 @@ {{- $pvcName = . -}} {{- end -}} {{- end }} -- name: {{ tpl (toString $index) $root }} +- name: {{ $index }} persistentVolumeClaim: claimName: {{ tpl $pvcName $root }} {{- end -}} diff --git a/library/common/1.0.0/templates/lib/pod/volumes/_secret.tpl b/library/common/1.0.0/templates/lib/pod/volumes/_secret.tpl index cedb62cc..c64b051c 100644 --- a/library/common/1.0.0/templates/lib/pod/volumes/_secret.tpl +++ b/library/common/1.0.0/templates/lib/pod/volumes/_secret.tpl @@ -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 }}