apiVersion: v1
kind: Pod
metadata:
  name: test-job-run-pod
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: frolvlad/alpine-bash
      imagePullPolicy: IfNotPresent
      command:
        - bash
        - -c
        - |
          echo "Running tester..."
          sleep 2
          RNUM=$((RANDOM%100))
          echo "Error chance roll: $RNUM"
          if [ "$RNUM" -gt "$SUCCESS_CHANCE" ]; then
            echo "Force throw error"
            exit 1
          else
            echo "Done succesfully"
          fi
      env:
        - name: SUCCESS_CHANCE
          value: '10'
