# helm_charts_artifactory-pvc.yaml
{{- if and .Values.artifactory.persistence.enabled (not .Values.artifactory.persistence.existingClaim) -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ template "artifactory.fullname" . }}
  labels:
    app: {{ template "artifactory.name" . }}
    chart: {{ template "artifactory.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
{{- if .Values.artifactory.persistence.annotations }}
  annotations:
{{ toYaml .Values.artifactory.persistence.annotations | indent 4 }}
{{- end }}
spec:
  accessModes:
    - {{ .Values.artifactory.persistence.accessMode | quote }}
  resources:
    requests:
      storage: {{ .Values.artifactory.persistence.size | quote }}
{{- if .Values.artifactory.persistence.storageClass }}
{{- if (eq "-" .Values.artifactory.persistence.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.artifactory.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}