{{- if and (.Values.persistence.enabled) (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  {{- if .Values.persistence.annotations }}
  annotations:
    {{- toYaml .Values.persistence.annotations | nindent 4 }}
  {{- end }}
  name: {{ include "umap.pvcName" . }}
  labels:
    {{- include "umap.labels" . | nindent 4 }}
spec:
  accessModes:
  {{- range .Values.persistence.accessModes }}
    - {{ . | quote }}
  {{- end }}
  {{- with .Values.persistence.resources }}
  resources:
  {{- toYaml . | nindent 4 }}
  {{- end }}
  {{- if .Values.persistence.storageClassName }}
  storageClassName: {{ .Values.persistence.storageClassName | quote }}
  {{- end }}
{{- end }}