{{- if and .Values.persistence.enabled (not .Values.persistence.persistentVolumeClaim.jobservice.existingClaim) }}
{{- if eq .Values.jobservice.jobLogger "file" }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ include "harbor.jobservice" . }}
  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: jobservice
  annotations:
  {{- if eq .Values.persistence.resourcePolicy "keep" }}
    helm.sh/resource-policy: keep
  {{- end }}
  {{- if .Values.commonAnnotations }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
spec:
  accessModes:
    - {{ .Values.persistence.persistentVolumeClaim.jobservice.accessMode }}
  resources:
    requests:
      storage: {{ .Values.persistence.persistentVolumeClaim.jobservice.size }}
  {{- include "harbor.jobservice.storageClass" . | nindent 2 }}
{{- end }}
{{- end }}
