---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: openebs-upgrade-
  namespace: litmus
spec:
  template:
    metadata:
      name: openebs-upgrade
      namespace: litmus
      labels:
        loadgen: openebs-upgradejob
    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: Always
        env: 
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            value: default
            
          - name: APP_LABEL
            value: name=percona

          - name: APP_PVC
            value: percona-mysql-claim
  
          - name: DEPLOY_TYPE
            value: deployment

          # Provide name POOL_NAME for the cstor-pool (for cstor upgrade)
          - name: POOL_NAME
            value: cstor-disk-pool

          - name: APP_NAMESPACE
            value: app-percona-ns

          - name: LIVENESS_APP_LABEL
            value: "liveness=percona-liveness"

          - name: LIVENESS_APP_NAMESPACE
            value: "litmus" 

          - name: SOURCE_DESTINATION_TAG
            value: "0.8.0-0.8.1"

          - name: STORAGE_ENGINE
            value: "jiva"

          - name: CURRENT_TAG
            value: "0.8.0"  

          - name: RELEASE_TAG
            value: "0.8.1-RC1"

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./experiments/functional/upgrade/test.yml -i /etc/ansible/hosts -vv; exit 0"]
