---
apiVersion: batch/v1
kind: CronJob
metadata:
  namespace: media
  name: tag-tracker-errors
spec:
  schedule: "0 * * * *"
  concurrencyPolicy: "Forbid"
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 5
  jobTemplate:
    spec:
      backoffLimit: 3
      ttlSecondsAfterFinished: 300
      template:
        spec:
          restartPolicy: Never
          containers:
            - name: qbittorrent-scripts
              image: ghcr.io/k8s-at-home/qbittorrent-scripts:v1.0.0
              env:
                - name: QB_HOST
                  value: http://qbittorrent:8080
                - name: QB_TAG
                  value: "Tracker Errors"
                - name: QB_USERNAME
                  value: "${SECRET_QB_USERNAME}"
                - name: QB_PASSWORD
                  value: "${SECRET_QB_PASSWORD}"
              args:
                - "/app/tag-tracker-errors.py"
