{{- if .Values.persistence.enabled }}
{{- if and (not .Values.persistence.persistentVolumeClaim.registry.existingClaim) (eq .Values.persistence.imageChartStorage.type "filesystem") }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ include "harbor.registry" . }}
  {{- if eq .Values.persistence.resourcePolicy "keep" }}
  annotations:
    helm.sh/resource-policy: keep
  {{- end }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    {{- end }}
    app.kubernetes.io/component: registry
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
spec:
  accessModes:
    - {{ .Values.persistence.persistentVolumeClaim.registry.accessMode }}
  resources:
    requests:
      storage: {{ .Values.persistence.persistentVolumeClaim.registry.size }}
  {{- include "harbor.registry.storageClass" . | nindent 2 }}
{{- end }}
{{- end }}
