From 4e6d0fcb8df5430303bc24a12e3ed36d1ad7f7e5 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sat, 24 Feb 2024 10:15:53 +0100 Subject: [PATCH] Delete library/common/templates/lib/pod/volumes/_ixVolume.tpl --- .../templates/lib/pod/volumes/_ixVolume.tpl | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 library/common/templates/lib/pod/volumes/_ixVolume.tpl diff --git a/library/common/templates/lib/pod/volumes/_ixVolume.tpl b/library/common/templates/lib/pod/volumes/_ixVolume.tpl deleted file mode 100644 index d29ada1d..00000000 --- a/library/common/templates/lib/pod/volumes/_ixVolume.tpl +++ /dev/null @@ -1,56 +0,0 @@ -{{/* Returns ixVolume Volume */}} -{{/* Call this template: -{{ include "tc.v1.common.lib.pod.volume.ixVolume" (dict "rootCtx" $ "objectData" $objectData) }} -rootCtx: The root context of the chart. -objectData: The object data to be used to render the volume. -*/}} -{{- define "tc.v1.common.lib.pod.volume.ixVolume" -}} - {{- $rootCtx := .rootCtx -}} - {{- $objectData := .objectData -}} - - {{- $hostPathType := "" -}} - {{- if $objectData.hostPathType -}} - {{- $hostPathType = tpl $objectData.hostPathType $rootCtx -}} - {{- end -}} - - {{- if not $objectData.datasetName -}} - {{- fail "Persistence - Expected non-empty [datasetName] on [ixVolume] type" -}} - {{- end -}} - {{- $datasetName := tpl $objectData.datasetName $rootCtx -}} - - {{- if not $rootCtx.Values.ixVolumes -}} - {{- fail "Persistence - Expected non-empty [ixVolumes] in values on [ixVolume] type" -}} - {{- end -}} - - {{- $hostPath := "" -}} - {{- $found := false -}} - {{- range $idx, $normalizedHostPath := $rootCtx.Values.ixVolumes -}} - {{- if eq $datasetName (base $normalizedHostPath.hostPath) -}} - {{- $found = true -}} - {{- $hostPath = $normalizedHostPath.hostPath -}} - {{- end -}} - {{- end -}} - - {{- if not $found -}} {{/* If we go over the ixVolumes and we dont find a match, fail */}} - {{- $datasets := list -}} - {{- range $rootCtx.Values.ixVolumes -}} - {{- $datasets = mustAppend $datasets (base .hostPath) -}} - {{- end -}} - {{- fail (printf "Persistence - Expected [datasetName] [%s] to exist on [ixVolumes] list, but list contained [%s] on [ixVolume] type" $datasetName (join ", " $datasets)) -}} - {{- end -}} - - {{- if not (hasPrefix "/" $hostPath) -}} - {{- fail "Persistence - Expected normalized path from [ixVolumes] to start with a forward slash [/] on [ixVolume] type" -}} - {{- end -}} - - {{- $types := (list "DirectoryOrCreate" "Directory" "FileOrCreate" "File" "Socket" "CharDevice" "BlockDevice") -}} - {{- if and $hostPathType (not (mustHas $hostPathType $types)) -}} - {{- fail (printf "Persistence - Expected [hostPathType] to be one of [%s], but got [%s]" (join ", " $types) $hostPathType) -}} - {{- end }} -- name: {{ $objectData.shortName }} - hostPath: - path: {{ $hostPath }} - {{- with $hostPathType }} - type: {{ $hostPathType }} - {{- end -}} -{{- end -}}