_persistence.tpl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {{- define "navidrome.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. {{- include "navidrome.storage.ci.migration" (dict "storage" .Values.navidromeStorage.data) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.navidromeStorage.data) | nindent 4 }}
  7. targetSelector:
  8. navidrome:
  9. navidrome:
  10. mountPath: /data
  11. {{- if and (eq .Values.navidromeStorage.data.type "ixVolume")
  12. (not (.Values.navidromeStorage.data.ixVolumeConfig | default dict).aclEnable) }}
  13. 01-permissions:
  14. mountPath: /mnt/directories/data
  15. {{- end }}
  16. music:
  17. enabled: true
  18. {{- include "navidrome.storage.ci.migration" (dict "storage" .Values.navidromeStorage.music) }}
  19. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.navidromeStorage.music) | nindent 4 }}
  20. targetSelector:
  21. navidrome:
  22. navidrome:
  23. mountPath: /music
  24. {{- if and (eq .Values.navidromeStorage.music.type "ixVolume")
  25. (not (.Values.navidromeStorage.music.ixVolumeConfig | default dict).aclEnable) }}
  26. 01-permissions:
  27. mountPath: /mnt/directories/music
  28. {{- end }}
  29. {{- range $idx, $storage := .Values.navidromeStorage.additionalStorages }}
  30. {{ printf "navidrome-%v:" (int $idx) }}
  31. enabled: true
  32. {{- include "navidrome.storage.ci.migration" (dict "storage" $storage) }}
  33. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  34. targetSelector:
  35. navidrome:
  36. navidrome:
  37. mountPath: {{ $storage.mountPath }}
  38. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  39. 01-permissions:
  40. mountPath: /mnt/directories{{ $storage.mountPath }}
  41. {{- end }}
  42. {{- end }}
  43. {{- end -}}
  44. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  45. {{- define "navidrome.storage.ci.migration" -}}
  46. {{- $storage := .storage -}}
  47. {{- if $storage.hostPath -}}
  48. {{- $_ := set $storage "hostPathConfig" dict -}}
  49. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  50. {{- end -}}
  51. {{- end -}}