---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: cstor-csi-upgrade-
  namespace: e2e
spec:
  template:
    metadata:
      name: e2e
      labels:
        app: cstor-csi-upgrade
    spec:
      serviceAccountName: e2e
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/upgrade-e2e:ci
        imagePullPolicy: IfNotPresent

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default

            # OpenEBS Version already installed
          - name: FROM_VERSION
            value: ""

            # OpenEBS version to be Upgraded
          - name: TO_VERSION
            value: ""
            
          - name: RELEASE_VERSION
            value: ""

            # Namespace where OpenEBS is deployed
          - name: OPERATOR_NS
            value: "openebs"

            # Image tag for Upgrade Job
          - name: UPGRADE_IMAGE_TAG
            value: ""
             
            # set to "true" if you want to upgrade cStor CSPC pool
          - name: CSPC_POOL_UPGRADE
            value: ""

            # set to "true" if you want to upgrade CSI volumes        
          - name: CSI_VOLUME_UPGRADE
            value: ""

            # set to "true" to upgrade CSTOR OPERATOR  plane
          - name: CSTOR_OPERATOR_UPGRADE
            value: ""

          - name: COMMIT_ID
            value: ""

          - name: RC_TAG
            value: ""

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./e2e-tests/experiments/cspc_csi_upgrade/test.yml -i /etc/ansible/hosts -v; exit 0"]
