---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: build
spec:
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 3
  concurrencyPolicy: Forbid
  schedule: "51 * * * *"
  startingDeadlineSeconds: 500
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            parent: "cleanup"
        spec:
          restartPolicy: Never
          containers:
          - name: easyfix
            image: image-registry.openshift-image-registry.svc:5000/easyfix/easyfix:latest
            command: ["/opt/app-root/bin/fedora-gather-easyfix", "-c", "/etc/easyfix/config.toml"]
            volumeMounts:
              - name: config
                mountPath: "/etc/easyfix"
                readOnly: true
              - name: data
                mountPath: "/srv"
          volumes:
            - name: config
              configMap:
                name: config
            - name: data
              persistentVolumeClaim:
                  claimName: data
