apiVersion: batch/v1
kind: Job
metadata:
  name: funcbench-test-{{ .PR_NUMBER }}
  namespace: funcbench-{{ .PR_NUMBER }}
spec:
  # never re-create a new pod
  backoffLimit: 0
  template:
    spec:
      restartPolicy: Never
      containers:
      - name: funcbench
        image: docker.io/prominfra/funcbench:master
        imagePullPolicy: Always
        args:
          - "--verbose"
          - "--owner"
          - "{{ .GITHUB_ORG }}"
          - "--repo"
          - "{{ .GITHUB_REPO }}"
          - "--github-pr"
          - "{{ .PR_NUMBER }}"
          - "{{ .BRANCH }}"
          - "{{ .BENCH_FUNC_REGEX }}"
          - "{{ .PACKAGE_PATH }}"
        env:
          - name: GITHUB_TOKEN
            valueFrom:
              secretKeyRef:
                name: github-token
                key: token
      nodeSelector:
        node-name: funcbench-{{ .PR_NUMBER }}
