apiVersion: batch/v1beta1
kind: CronJob
metadata:
  labels:
    api.openshift.com/managed: "true"
  name: builds-pruner
  namespace: openshift-sre-pruning
spec:
  concurrencyPolicy: Replace
  failedJobsHistoryLimit: 5
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - command:
            - oc
            - adm
            - prune
            - builds
            - --keep-younger-than=24h
            - --keep-complete=1
            - --keep-failed=1
            - --confirm
            image: image-registry.openshift-image-registry.svc:5000/openshift/cli:latest
            imagePullPolicy: Always
            name: builds-pruner
          restartPolicy: Never
          serviceAccountName: sre-pruner-sa
  schedule: 0 */1 * * *
