apiVersion: batch/v1beta1
kind: CronJob
metadata:
  namespace: default
  name: branchprotector
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:v20190906-eff7a2073
            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
