apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: kuryr-rebaser
spec:
  schedule: "0 7 * * 1,3,5"
  jobTemplate:
    spec:
      backoffLimit: 1
      template:
        spec:
          restartPolicy: Never
          containers:
          - name: rebaser
            image: docker.io/dulek/kuryr-rebaser
            command:
            - /bin/bash
            - -c
            - |
              #!/bin/bash
              set -ex
              python /script/rebaser.py  \
                https://opendev.org/openstack/kuryr-kubernetes \
                https://github.com/openshift/kuryr-kubernetes \
                git@github.com:kuryr-bot/kuryr-kubernetes \
                /tmp /credentials/gh-key /credentials/gh-token \
                /credentials/slack-webhook
            volumeMounts:
            - name: script
              mountPath: /script
            - name: credentials
              mountPath: /credentials
          volumes:
          - name: script
            configMap:
              name: script
          - name: credentials
            secret:
              secretName: bot-credentials
              defaultMode: 0700
