{{ if not .Values.persistence.media.existingClaim }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    helm.sh/resource-policy: keep
  name: {{ include "dendrite.fullname" . }}-media-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.persistence.media.capacity }}
  storageClassName: {{ default .Values.persistence.storageClass .Values.persistence.media.storageClass }}
{{ end }}
{{ if not .Values.persistence.jetstream.existingClaim }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    helm.sh/resource-policy: keep
  name: {{ include "dendrite.fullname" . }}-jetstream-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.persistence.jetstream.capacity }}
  storageClassName: {{ default .Values.persistence.storageClass .Values.persistence.jetstream.storageClass }}
{{ end }}
{{ if not .Values.persistence.search.existingClaim }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    helm.sh/resource-policy: keep
  name: {{ include "dendrite.fullname" . }}-search-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.persistence.search.capacity }}
  storageClassName: {{ default .Values.persistence.storageClass .Values.persistence.search.storageClass }}
{{ end }}
