apiVersion: batch/v1
kind: Job
metadata:
  name: rollback-astronomer
spec:
  backoffLimit: 0
  template:
    metadata:
      labels:
        run: test-rollback
    spec:
      serviceAccountName: astronomer-upgrader-service-account
      restartPolicy: Never
      containers:
        - image: quay.io/astronomer/lts-016-023-upgrade:latest
          imagePullPolicy: Always
          name: upgrade
          command:
            - ansible-playbook
            - rollback-astronomer.yaml
          volumeMounts:
            - mountPath: /astronomer-backups
              name: astronomer-upgrades-backup
      terminationGracePeriodSeconds: 300
      volumes:
        - name: astronomer-upgrades-backup
          persistentVolumeClaim:
            claimName: astronomer-upgrades-backup
