{{- if .Values.persistence.enabled -}}
{{- if not .Values.persistence.existingClaim -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "superset.fullname" . }}
  labels:
    app: {{ include "superset.name" . }}
    chart: {{ include "superset.chart" . }}
    release: {{ .Release.Name }}
spec:
  accessModes:
    {{- .Values.persistence.accessModes | toYaml | nindent 4 }}
  {{- if .Values.persistence.storageClass }}
  {{- if (eq "-" .Values.persistence.storageClass) }}
  storageClassName: ""
  {{- else }}
  storageClassName: "{{ .Values.persistence.storageClass }}"
  {{- end }}
  {{- end }}
  resources:
    requests:
      storage: "{{ .Values.persistence.size }}"
{{- end }}
{{- end }}
