# helm_charts_magento-pvc.yaml
{{- if .Values.persistence.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ template "magento.fullname" . }}-magento
  labels:
    app: {{ template "magento.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  accessModes:
    - {{ .Values.persistence.magento.accessMode | quote }}
  resources:
    requests:
      storage: {{ .Values.persistence.magento.size | quote }}
{{- if .Values.persistence.magento.storageClass }}
{{- if (eq "-" .Values.persistence.magento.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.persistence.magento.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}