{{ if .Values.jenkins.backup.pvc.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: jenkins-backup
  namespace: {{ .Values.jenkins.namespace }}
  labels:
    app: jenkins-operator
    jenkins-cr: {{ .Values.jenkins.name }}
spec:
  {{- if .Values.jenkins.backup.pvc.className }}
  {{- if (eq "-" .Values.jenkins.backup.pvc.className) }}
  storageClassName: ""
  {{- else }}
  storageClassName: "{{ .Values.jenkins.backup.pvc.className }}"
  {{- end }}
  {{- end }}
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.jenkins.backup.pvc.size }}
{{ end }}