apiVersion: batch/v1
kind: Job
metadata:
  name: kuryr-rebaser
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
