apiVersion: batch/v1beta1
kind: CronJob
metadata:
  namespace: prow
  name: label-sync
spec:
  schedule: "30 12 * * *"  # Every day 12:30
  concurrencyPolicy: Forbid
  jobTemplate:
    metadata:
      labels:
        app: label-sync
    spec:
      template:
        spec:
          containers:
            - name: label-sync
              image: gcr.io/k8s-prow/label_sync:v20201204-d90be1ef6b
              args:
                - --config=/etc/config/labels.yaml
                - --confirm=true
                - --only=tidb-community-bots/ti-community-prow,tidb-community-bots/configs,tidb-community-bots/ti-community-bot,tidb-community-bots/ti-challenge-bot,pingcap/tiup,pingcap/community,tikv/community
                - --token=/etc/github/token
              volumeMounts:
                - name: github-token
                  mountPath: /etc/github
                  readOnly: true
                - name: config
                  mountPath: /etc/config
                  readOnly: true
          restartPolicy: Never
          volumes:
            - name: github-token
              secret:
                secretName: github-token
            - name: config
              configMap:
                name: labels-config