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

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays, actionable, default
            value: default

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

            # OpenEBS version to be Upgraded
          - name: TO_VERSION
            value: ""
            
            # Namespace where OpenEBS is deployed
          - name: OPERATOR_NS
            value: "openebs"

            # Namespace where OpenEBS csi operator is deployed
          - name: CSI_NAMESPACE
            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: ""

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