apiVersion: batch/v1
kind: CronJob
metadata:
  name: branch-protector
spec:
  schedule: "54 * * * *"  # Every hour at 54 minutes past the hour
  concurrencyPolicy: Forbid
  jobTemplate:
    metadata:
      labels:
        app: branchprotector
    spec:
      template:
        spec:
          containers:
            - name: branchprotector
              image: gcr.io/k8s-prow/branchprotector:v20211104-016e918fc0
              args:
                - --config-path=/etc/config/config.yaml
                - --job-config-path=/etc/job-config
                - --github-token-path=/etc/github/oauth
                - --confirm
                - --github-endpoint=http://ghproxy
                - --github-endpoint=https://api.github.com
              volumeMounts:
                - name: oauth
                  mountPath: /etc/github
                  readOnly: true
                - name: config
                  mountPath: /etc/config
                  readOnly: true
                - name: job-config
                  mountPath: /etc/job-config
                  readOnly: true
          restartPolicy: Never
          volumes:
            - name: oauth
              secret:
                secretName: oauth-token
            - name: config
              configMap:
                name: config
            - name: job-config
              configMap:
                name: job-config
