_persistence.tpl 1.1 KB

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