{{- if .Values.persistence.enabled -}}
{{- if not .Values.persistence.apache.existingClaim -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ template "owncloud.fullname" . }}-owncloud
spec:
  accessModes:
    - {{ .Values.persistence.owncloud.accessMode | quote }}
  resources:
    requests:
      storage: {{ .Values.persistence.owncloud.size | quote }}
{{- if .Values.persistence.owncloud.storageClass }}
{{- if (eq "-" .Values.persistence.owncloud.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.persistence.owncloud.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
