Skip to content

Commit 0a36460

Browse files
authored
Merge pull request #55859 from sheriff-rh/OCPBUGS-7363
2 parents e8544e0 + 60c28d2 commit 0a36460

File tree

3 files changed

+126
-5
lines changed

3 files changed

+126
-5
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// Module included in the following assemblies:
2+
//
3+
// security/compliance_operator/compliance-operator-uninstallation.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="compliance-operator-uninstall-cli_{context}"]
7+
= Uninstalling the OpenShift Compliance Operator from {product-title} using the CLI
8+
9+
To remove the Compliance Operator, you must first delete the objects in the namespace. After the objects are removed, you can remove the Operator and its namespace by deleting the *openshift-compliance* project.
10+
11+
.Prerequisites
12+
13+
* Access to an {product-title} cluster using an account with `cluster-admin` permissions.
14+
* The OpenShift Compliance Operator must be installed.
15+
16+
.Procedure
17+
18+
. Delete all objects in the namespace.
19+
20+
.. Delete the `ScanSettingBinding` objects:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc delete ssb <ScanSettingBinding-name> -n openshift-compliance
25+
----
26+
27+
.. Delete the `ScanSetting` objects:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc delete ss <ScanSetting-name> -n openshift-compliance
32+
----
33+
34+
.. Delete the `ComplianceSuite` objects:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc delete suite <compliancesuite-name> -n openshift-compliance
39+
----
40+
41+
.. Delete the `ComplianceScan` objects:
42+
+
43+
[source,terminal]
44+
----
45+
$ oc delete scan <compliancescan-name> -n openshift-compliance
46+
----
47+
48+
.. Obtain the `ProfileBundle` objects:
49+
+
50+
[source,terminal]
51+
----
52+
$ oc get profilebundle.compliance -n openshift-compliance
53+
----
54+
+
55+
.Example output
56+
[source,terminal]
57+
----
58+
NAME CONTENTIMAGE CONTENTFILE STATUS
59+
ocp4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:<hash> ssg-ocp4-ds.xml VALID
60+
rhcos4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256:<hash> ssg-rhcos4-ds.xml VALID
61+
----
62+
63+
.. Delete the `ProfileBundle` objects:
64+
+
65+
[source,terminal]
66+
----
67+
$ oc delete profilebundle.compliance ocp4 rhcos4 -n openshift-compliance
68+
----
69+
+
70+
.Example output
71+
[source,terminal]
72+
----
73+
profilebundle.compliance.openshift.io "ocp4" deleted
74+
profilebundle.compliance.openshift.io "rhcos4" deleted
75+
----
76+
77+
. Delete the Subscription object:
78+
+
79+
[source,terminal]
80+
----
81+
$ oc delete sub <Subscription-Name> -n openshift-compliance
82+
----
83+
84+
. Delete the CSV object:
85+
+
86+
[source,terminal]
87+
----
88+
$ oc delete CSV -n openshift-compliance
89+
----
90+
91+
. Delete the project:
92+
+
93+
[source,terminal]
94+
----
95+
$ oc delete project -n openshift-compliance
96+
----
97+
+
98+
.Example output
99+
[source,terminal]
100+
----
101+
project.project.openshift.io "openshift-compliance" deleted
102+
----
103+
104+
.Verification
105+
106+
. Confirm the namespace is deleted:
107+
+
108+
[source,terminal]
109+
----
110+
$ oc get project/openshift-compliance
111+
----
112+
+
113+
.Example output
114+
[source,terminal]
115+
----
116+
Error from server (NotFound): namespaces "openshift-compliance" not found
117+
----

modules/compliance-operator-uninstall.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
:_content-type: PROCEDURE
66
[id="compliance-operator-uninstall_{context}"]
7-
= Uninstalling the OpenShift Compliance Operator from {product-title}
7+
= Uninstalling the OpenShift Compliance Operator from {product-title} using the web console
88

9-
To remove the Compliance Operator, you must first delete the Compliance Operator custom resource definitions (CRDs). After the CRDs are removed, you can then remove the Operator and its namespace by deleting the *openshift-compliance* project.
9+
To remove the Compliance Operator, you must first delete the objects in the namespace. After the objects are removed, you can remove the Operator and its namespace by deleting the *openshift-compliance* project.
1010

1111
.Prerequisites
1212

@@ -17,9 +17,11 @@ To remove the Compliance Operator, you must first delete the Compliance Operator
1717

1818
To remove the Compliance Operator by using the {product-title} web console:
1919

20-
. Navigate to the *Operators* -> *Installed Operators* page.
20+
. Go to the *Operators* -> *Installed Operators* -> *Compliance Operator* page.
2121

22-
. Delete all ScanSettingBinding, ComplainceSuite, ComplianceScan, and ProfileBundle objects.
22+
.. Click *All instances*.
23+
24+
.. In *All namespaces*, click the Options menu {kebab} and delete all ScanSettingBinding, ComplainceSuite, ComplianceScan, and ProfileBundle objects.
2325

2426
. Switch to the *Administration* -> *Operators* -> *Installed Operators* page.
2527

security/compliance_operator/compliance-operator-uninstallation.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
You can remove the OpenShift Compliance Operator from your cluster by using the {product-title} web console.
9+
You can remove the OpenShift Compliance Operator from your cluster by using the {product-title} web console or the CLI.
1010

1111
include::modules/compliance-operator-uninstall.adoc[leveloffset=+1]
12+
13+
include::modules/compliance-operator-cli-uninstall.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)