# TODO: this is currently not deployed, as label_sync doesn't support GitHub Apps Auth yet
# see https://github.com/kubernetes/test-infra/issues/24143
# For now, label_sync can be trigger manually via hack/label-sync.sh
apiVersion: batch/v1
kind: CronJob
metadata:
  name: label-sync
  namespace: prow
spec:
  schedule: "17 * * * *"  # Every hour at 17 minutes past the hour
  concurrencyPolicy: Forbid
  jobTemplate:
    metadata:
      labels:
        app: label-sync
    spec:
      template:
        spec:
          containers:
            - name: label-sync
              image: gcr.io/k8s-prow/label_sync:v20210928-0afc0f8086
              args:
              - --config=/etc/config/labels.yaml
              - --confirm=true
              - --only=gardener/ci-infra
              - --token=/etc/github/oauth
              volumeMounts:
              - name: oauth
                mountPath: /etc/github
                readOnly: true
              - name: config
                mountPath: /etc/config
                readOnly: true
          restartPolicy: Never
          volumes:
          - name: oauth
            secret:
              secretName: oauth-token
          - name: config
            configMap:
              name: label-config
