Infrastructure Management vm operator encounters an error when upgrading on OpenShift

When you are upgrading Infrastructure Management, you can encounter an error where the operator fails to install correctly.

Checking the OpenShift console InstalledOperators for project: management-infrastructure-management shows the operator in "Failed" state. Checking oc describe shows a message "conflicting CRD owner in namespace". For example,

oc describe operator ibm-management-infra-vm.management-infrastructure-management
Name:         ibm-management-infra-vm.management-infrastructure-management
Namespace:
Labels:       <none>
Annotations:  <none>
API Version:  operators.coreos.com/v1
Kind:         Operator
Metadata:
  ...
  ...
      Namespace:               management-infrastructure-management
      API Version:             operators.coreos.com/v1alpha1
      Conditions:
        Last Transition Time:  2020-11-23T23:19:46Z
        Last Update Time:      2020-11-23T23:19:46Z
        Message:               installing: missing deployment with name=infra-management-vm-operator
        Reason:                NeedsReinstall
        Status:                True
        Type:                  Pending
      Kind:                    ClusterServiceVersion
      Name:                    ibm-management-infra-vm.v2.2.3-202011230408
      Namespace:               management-infrastructure-management
      API Version:             operators.coreos.com/v1alpha1
      Conditions:
        Last Transition Time:  2020-11-23T23:19:44Z
        Last Update Time:      2020-11-23T23:19:44Z
        Message:               conflicting CRD owner in namespace
        Reason:                OwnerConflict
        Status:                True
        Type:                  Failed
      Kind:                    ClusterServiceVersion
      Name:                    ibm-management-infra-vm.v2.2.3-202011231858
      Namespace:               management-infrastructure-management
Events:                        <none>

This error CAN be seen when conflicting CSVs exist:

oc get csv -n management-infrastructure-management

Output:

NAME                                                 DISPLAY                                              VERSION              REPLACES                                             PHASE
ibm-management-infra-vm.v2.2.3-202011231109          IBM Management Infrastructure for virtual machines   2.2.3-202011231109   ibm-management-infra-vm.v2.2.3-202011230859          Replacing
ibm-management-infra-vm.v2.2.5-202012021409          IBM Management Infrastructure for virtual machines   2.2.5-202012021409   ibm-management-infra-vm.v2.2.3-202011231109          Succeeded

Solution: Delete any older CSVs and this will allow the operator to install.

oc delete csv -n management-infrastructure-management ibm-management-infra-vm.v2.2.3-202011231109

oc delete csv -n management-infrastructure-management ibm-management-infra-vm.v2.2.3-202011230859