Repairing the DevWorkspace Operator on OpenShift
Under certain conditions, such as OLM restart or cluster upgrade, the Eclipse Che Operator for Che might automatically install the DevWorkspace Operator even when it is already present on the cluster. In that case, you can repair the DevWorkspace Operator on OpenShift as follows:
-
An active
kubectlsession as a cluster administrator to the destination OpenShift cluster. See Overview of kubectl. -
On the Installed Operators page of the Kubernetes or OpenShift web console, you see multiple entries for the DevWorkspace Operator or one entry that is stuck in a loop of Replacing and Pending.
-
Delete the
devworkspace-controllernamespace that contains the failing pod. -
Update
DevWorkspaceandDevWorkspaceTemplateCustom Resource Definitions (CRD) by setting the conversion strategy toNoneand removing the entirewebhooksection:spec: ... conversion: strategy: None status: ...You can find and edit the DevWorkspaceandDevWorkspaceTemplateCRDs in the Administrator perspective of the OpenShift web console by searching forDevWorkspacein .The DevWorkspaceOperatorConfigandDevWorkspaceRoutingCRDs have the conversion strategy set toNoneby default. -
Remove the DevWorkspace Operator subscription:
$ oc delete sub devworkspace-operator \ -n openshift-operators (1)
1 openshift-operatorsor an OpenShift namespace where the DevWorkspace Operator is installed. -
Get the DevWorkspace Operator CSVs in the <devworkspace_operator.vX.Y.Z> format:
$ oc get csv | grep devworkspace
-
Remove each DevWorkspace Operator CSV:
$ oc delete csv <devworkspace_operator.vX.Y.Z> \ -n openshift-operators (1)
1 openshift-operatorsor an OpenShift namespace where the DevWorkspace Operator is installed. -
Re-create the DevWorkspace Operator subscription:
$ cat <<EOF | oc apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: devworkspace-operator namespace: openshift-operators spec: channel: fast name: devworkspace-operator source: redhat-operators sourceNamespace: openshift-marketplace installPlanApproval: Automatic (1) startingCSV: devworkspace-operator.v0.37.0 EOF
1 AutomaticorManual.For installPlanApproval: Manual, in the Administrator perspective of the OpenShift web console, go to and select the following for the DevWorkspace Operator: . -
In the Administrator perspective of the OpenShift web console, go to and verify the Succeeded status of the DevWorkspace Operator.