_appStorage.tpl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{/*
  2. Define appVolumeMounts for container
  3. */}}
  4. {{- define "common.storage.configureAppVolumeMountsInContainer" -}}
  5. {{- if and .Values.appVolumesEnabled .Values.appVolumeMounts }}
  6. {{- range $name, $avm := .Values.appVolumeMounts -}}
  7. {{- if (default true $avm.enabled) }}
  8. {{- if $avm.containerNameOverride -}}
  9. {{- $name = $avm.containerNameOverride -}}
  10. {{- end -}}
  11. - name: {{ $name }}
  12. mountPath: {{ $avm.mountPath }}
  13. {{- if $avm.subPath }}
  14. subPath: {{ $avm.subPath }}
  15. {{- end }}
  16. {{- end }}
  17. {{- end }}
  18. {{- end }}
  19. {{- end -}}
  20. {{/*
  21. Define hostPath for appVolumes
  22. */}}
  23. {{- define "common.storage.configureAppVolumes" -}}
  24. {{- if .Values.appVolumeMounts }}
  25. {{- range $name, $av := .Values.appVolumeMounts -}}
  26. {{- if (default true $av.enabled) }}
  27. - name: {{ $name }}
  28. {{- if or $av.emptyDir $.Values.emptyDirVolumes }}
  29. emptyDir: {}
  30. {{- else }}
  31. hostPath:
  32. {{ if $av.hostPathEnabled }}
  33. path: {{ required "hostPath not set" $av.hostPath }}
  34. {{- else }}
  35. {{- include "common.schema.validateKeys" (dict "values" $av "checkKeys" (list "datasetName")) -}}
  36. {{- $volDict := dict "datasetName" $av.datasetName "ixVolumes" $.Values.ixVolumes -}}
  37. path: {{ include "common.storage.retrieveHostPathFromiXVolume" $volDict }}
  38. {{- end }}
  39. {{- end }}
  40. {{- end }}
  41. {{- end }}
  42. {{- end }}
  43. {{- end -}}