_persistence.tpl 1.7 KB

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