Repairing the Dev Workspace Operator on OpenShift
Under certain conditions, such as OLM restart or cluster upgrade, the Eclipse Che Operator for Che might automatically install the Dev Workspace Operator even when it is already present on the cluster. In that case, you can repair the Dev Workspace Operator on OpenShift as follows:
-
An active
kubectl
session 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 Dev Workspace Operator or one entry that is stuck in a loop of Replacing and Pending.
-
Delete the
devworkspace-controller
namespace that contains the failing pod. -
Update
DevWorkspace
andDevWorkspaceTemplate
Custom Resource Definitions (CRD) by setting the conversion strategy toNone
and removing the entirewebhook
section:spec: ... conversion: strategy: None status: ...
You can find and edit the DevWorkspace
andDevWorkspaceTemplate
CRDs in the Administrator perspective of the OpenShift web console by searching forDevWorkspace
in .The DevWorkspaceOperatorConfig
andDevWorkspaceRouting
CRDs have the conversion strategy set toNone
by default. -
Remove the Dev Workspace Operator subscription:
$ oc delete sub devworkspace-operator \ -n openshift-operators (1)
1 openshift-operators
or an OpenShift namespace where the Dev Workspace Operator is installed. -
Get the Dev Workspace Operator CSVs in the <devworkspace_operator.vX.Y.Z> format:
$ oc get csv | grep devworkspace
-
Remove each Dev Workspace Operator CSV:
$ oc delete csv <devworkspace_operator.vX.Y.Z> \ -n openshift-operators (1)
1 openshift-operators
or an OpenShift namespace where the Dev Workspace Operator is installed. -
Re-create the Dev Workspace 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.15.2 EOF
1 Automatic
orManual
.For installPlanApproval: Manual
, in the Administrator perspective of the OpenShift web console, go to and select the following for the Dev Workspace Operator: . -
In the Administrator perspective of the OpenShift web console, go to
and verify the Succeeded status of the Dev Workspace Operator.