{{- if and .Values.persistence.data.enabled (not .Values.persistence.data.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: name: {{ template "qbittorrent.fullname" . }}-data labels: app.kubernetes.io/name: {{ include "qbittorrent.name" . }} helm.sh/chart: {{ include "qbittorrent.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} spec: accessModes: - {{ .Values.persistence.data.accessMode | quote }} resources: requests: storage: {{ .Values.persistence.data.size | quote }} {{- if .Values.persistence.data.storageClass }} {{- if (eq "-" .Values.persistence.data.storageClass) }} storageClassName: "" {{- else }} storageClassName: "{{ .Values.persistence.data.storageClass }}" {{- end }} {{- end }} {{- end -}}