_persistence.tpl 1.5 KB

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