{{- if .Values.persistence.enabled }}
{{- if not .Values.persistentVolumeClaim }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ template "mysqldump.fullname" . }}
  labels:
{{ include "mysqldump.labels" . | indent 4 }}
spec:
  accessModes: [{{ .Values.persistence.accessMode | quote }}]
  {{- if .Values.persistence.storageClass }}
  {{- if (eq "-" .Values.persistence.storageClass) }}
  storageClassName: ""
  {{- else }}
  storageClassName: "{{ .Values.persistence.storageClass }}"
  {{- end }}
  {{- end }}
  resources:
    requests:
      storage: {{ .Values.persistence.size }}
{{- end -}}
{{- end -}}
