_storage.tpl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {{/*
  2. Retrieve host path from ix volumes based on dataset name
  3. */}}
  4. {{- define "retrieveHostPathFromiXVolume" -}}
  5. {{- range $index, $hostPathConfiguration := $.ixVolumes }}
  6. {{- $dsName := base $hostPathConfiguration.hostPath -}}
  7. {{- if eq $.datasetName $dsName -}}
  8. {{- $hostPathConfiguration.hostPath -}}
  9. {{- end -}}
  10. {{- end }}
  11. {{- end -}}
  12. {{/*
  13. Retrieve host path for transcode
  14. Let's please remove the redundancy
  15. */}}
  16. {{- define "configuredHostPathTranscode" -}}
  17. {{- if .Values.transcodeHostPathEnabled -}}
  18. {{- .Values.transcodeHostPath -}}
  19. {{- else -}}
  20. {{- $volDict := dict "datasetName" $.Values.transcodeVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
  21. {{- include "retrieveHostPathFromiXVolume" $volDict -}}
  22. {{- end -}}
  23. {{- end -}}
  24. {{/*
  25. Retrieve host path for data
  26. Let's please remove the redundancy
  27. */}}
  28. {{- define "configuredHostPathData" -}}
  29. {{- if .Values.dataHostPathEnabled -}}
  30. {{- .Values.dataHostPath -}}
  31. {{- else -}}
  32. {{- $volDict := dict "datasetName" $.Values.dataVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
  33. {{- include "retrieveHostPathFromiXVolume" $volDict -}}
  34. {{- end -}}
  35. {{- end -}}
  36. {{/*
  37. Retrieve host path for transcode
  38. Let's please remove the redundancy
  39. */}}
  40. {{- define "configuredHostPathConfig" -}}
  41. {{- if .Values.configHostPathEnabled -}}
  42. {{- .Values.configHostPath -}}
  43. {{- else -}}
  44. {{- $volDict := dict "datasetName" $.Values.configVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
  45. {{- include "retrieveHostPathFromiXVolume" $volDict -}}
  46. {{- end -}}
  47. {{- end -}}