{{- if .Values.persistence.enabled }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ template "owprov.fullname" . }}-pvc
  labels:
    app.kubernetes.io/name: {{ include "owprov.name" . }}
    helm.sh/chart: {{ include "owprov.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
  {{- with .Values.persistence.annotations  }}
  annotations:
{{ toYaml . | indent 4 }}
  {{- end }}
spec:
  accessModes:
    {{- range .Values.persistence.accessModes }}
    - {{ . | quote }}
    {{- end }}
  resources:
    requests:
      storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClassName  }}
  storageClassName: {{ .Values.persistence.storageClassName }}
{{- end }}
{{- end }}
