_storage.tpl 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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 ipfs
  14. */}}
  15. {{- define "configuredHostPathData" -}}
  16. {{- if .Values.ipfsDataHostPathEnabled -}}
  17. {{- .Values.ipfsDataHostPath -}}
  18. {{- else -}}
  19. {{- $volDict := dict "datasetName" $.Values.ipfsDataVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
  20. {{- include "retrieveHostPathFromiXVolume" $volDict -}}
  21. {{- end -}}
  22. {{- end -}}
  23. {{/*
  24. Retrieve host path for ipfs
  25. */}}
  26. {{- define "configuredHostPathStaging" -}}
  27. {{- if .Values.ipfsStagingHostPathEnabled -}}
  28. {{- .Values.ipfsStagingHostPath -}}
  29. {{- else -}}
  30. {{- $volDict := dict "datasetName" $.Values.ipfsStagingVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
  31. {{- include "retrieveHostPathFromiXVolume" $volDict -}}
  32. {{- end -}}
  33. {{- end -}}