Upgrade of Platform UI (zen) operand fails

Symptom

Attempting to upgrade the ZenService custom resource results in the following error message that indicates the previous operation has not finished:

Requested operation is aborted as status for the current operation,
        install, is InProgress and requested version 4.5.0 is not the version of
        the previously started operation

Cause

This occurs when the operator is upgraded while the zen-operator is running a reconcile loop. During the upgrade of IBM Cloud Pak foundational services, ibm-platformui-operator is also upgraded. When ibm-platformui-operator is upgraded, a new reconcile loop will be triggered.

If you did not pin the version in zenservice custom resource, the zen operator will start an upgrade operation. However, the operation configuration map zen-lite-operation-configmap indicates that the previous operation has not finished and will throw the error message.

Solution

  1. Check the current version of operand that is set in the operation configuration map, zen-lite-operation-configmap.

    $ oc get cm zen-lite-operation-configmap -n ${zen_namespace} -o jsonpath="{.data.version}"
    4.5.0
    
  2. Add the following field in zenservice CR:

    $ oc patch zenservice lite-cr -n ${zen_namespace} --type="json" -p '[{"op": "replace", "path":"/spec/version", "value":"4.5.0" }]'
    
  3. Wait until the new loop is finished and the status of operation CM is set to Completed. Then run the following:

    $ oc get cm zen-lite-operation-configmap -n ${zen_namespace} -o jsonpath="{.data.status}"
    Completed
    
  4. Remove the version key in the zenservice CR to trigger upgrade.

    $ oc patch zenservice lite-cr -n ${zen_namespace} --type="json" -p '[{"op": "remove", "path":"/spec/version" }]'