_persistence.tpl 1.8 KB

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