apiVersion: batch/v1
kind: Job
metadata:
  name: branchprotector
spec:
  backoffLimit: 2
  template:
    metadata:
      name: branchprotector
    spec:
      containers:
        - name: branchprotector
          image: gcr.io/k8s-prow/branchprotector:v20220403-5ca3a768c0
          imagePullPolicy: IfNotPresent
          args:
            - --config-path=/etc/config/branchprotector-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
            - mountPath: /etc/job-config
              name: job-config
              readOnly: true
      restartPolicy: Never
      volumes:
        - name: oauth
          secret:
            secretName: oauth-token
        - name: config
          configMap:
            name: branchprotector-config
        - configMap:
            defaultMode: 420
            name: job-config
          name: job-config