_persistence.tpl 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {{- define "upb.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. {{- include "upb.storage.ci.migration" (dict "storage" .Values.upbStorage.config) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.upbStorage.config) | nindent 4 }}
  7. targetSelector:
  8. unifi-protect:
  9. unifi-protect:
  10. mountPath: /config
  11. data:
  12. enabled: true
  13. {{- include "upb.storage.ci.migration" (dict "storage" .Values.upbStorage.data) }}
  14. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.upbStorage.data) | nindent 4 }}
  15. targetSelector:
  16. unifi-protect:
  17. unifi-protect:
  18. mountPath: /data
  19. tmp:
  20. enabled: true
  21. type: emptyDir
  22. targetSelector:
  23. unifi-protect:
  24. unifi-protect:
  25. mountPath: /tmp
  26. {{- range $idx, $storage := .Values.upbStorage.additionalStorages }}
  27. {{ printf "upb-%v" (int $idx) }}:
  28. enabled: true
  29. {{- include "upb.storage.ci.migration" (dict "storage" $storage) }}
  30. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  31. targetSelector:
  32. unifi-protect:
  33. unifi-protect:
  34. mountPath: {{ $storage.mountPath }}
  35. {{- end }}
  36. {{- end -}}
  37. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  38. {{- define "upb.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 -}}