|
| 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 | +---- |
0 commit comments