Skip to content

Commit d399b37

Browse files
committed
OSDOCS-13230-ui: Added nmstate-console-plugin step to Uninstall K8S NMState Op
1 parent 676c98e commit d399b37

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

modules/k8s-nmstate-uninstall-operator.adoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ If you need to reinstall the Kubernetes NMState Operator, see "Installing the Ku
1515
.Prerequisites
1616

1717
* You have installed the {oc-first}.
18+
* You have installed the `jq` CLI tool.
1819
* You are logged in as a user with `cluster-admin` privileges.
1920
2021
.Procedure
@@ -59,7 +60,24 @@ $ oc -n openshift-nmstate delete nmstate nmstate
5960
$ oc delete --all deployments --namespace=openshift-nmstate
6061
----
6162

62-
. Delete all the custom resource definition (CRD), such as `nmstates`, that exist in the `nmstate.io` namespace by running the following commands:
63+
. After you deleted the `nmstate` CR, remove the `nmstate-console-plugin` console plugin name from the `console.operator.openshift.io/cluster` CR.
64+
+
65+
.. Store the position of the `nmstate-console-plugin` entry that exists among the list of enable plugins by running the following command. The following command uses the `jq` CLI tool to store the index of the entry in an environment variable named `INDEX`:
66+
+
67+
[source,terminal]
68+
----
69+
INDEX=$(oc get console.operator.openshift.io cluster -o json | jq -r '.spec.plugins | to_entries[] | select(.value == "nmstate-console-plugin") | .key')
70+
----
71+
+
72+
.. Remove the `nmstate-console-plugin` entry from the `console.operator.openshift.io/cluster` CR by running the following patch command:
73+
+
74+
[source,terminal]
75+
----
76+
$ oc patch console.operator.openshift.io cluster --type=json -p "[{\"op\": \"remove\", \"path\": \"/spec/plugins/$INDEX\"}]" <1>
77+
----
78+
<1> `INDEX` is an auxiliary variable. You can specify a different name for this variable.
79+
80+
. Delete all the custom resource definitions (CRDs), such as `nmstates.nmstate.io`, by running the following commands:
6381
+
6482
[source,terminal]
6583
----

0 commit comments

Comments
 (0)