apiVersion: batch/v1
kind: Job
metadata: {}
spec:
  backoffLimit: 2
  completions: 3
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: job-executor
          image: ubuntu
          command:
            - bash
            - -c
            - |
              #/usr/bin/env bash
              echo "Starting $PASS_ARG"
              cur_count=0
              while true; do
                  cur_count=$((cur_count + 1))
                  if [ "$cur_count" -ge "$TIC_COUNT" ]; then
                      break
                  fi
                  date
                  sleep 1
              done

              echo "Complete"
          env:
            - name: TIC_COUNT
              value: '2'
