_persistence.tpl 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. {{- define "kavita.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. {{- include "kavita.storage.ci.migration" (dict "storage" .Values.kavitaStorage.config) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.kavitaStorage.config) | nindent 4 }}
  7. targetSelector:
  8. kavita:
  9. kavita:
  10. mountPath: /kavita/config
  11. {{- range $idx, $storage := .Values.kavitaStorage.additionalStorages }}
  12. {{ printf "kavita-%v:" (int $idx) }}
  13. enabled: true
  14. {{- include "kavita.storage.ci.migration" (dict "storage" $storage) }}
  15. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  16. targetSelector:
  17. kavita:
  18. kavita:
  19. mountPath: {{ $storage.mountPath }}
  20. {{- end }}
  21. {{- end -}}
  22. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  23. {{- define "kavita.storage.ci.migration" -}}
  24. {{- $storage := .storage -}}
  25. {{- if $storage.hostPath -}}
  26. {{- $_ := set $storage "hostPathConfig" dict -}}
  27. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  28. {{- end -}}
  29. {{- end -}}