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