From e95a6750764176e76532af6095844112dd7d1c8e Mon Sep 17 00:00:00 2001 From: Andrew Taylor Date: Mon, 13 Feb 2023 15:06:12 -0500 Subject: [PATCH] Updating the Compliance Operator uninstallation procedure --- .../compliance-operator-cli-uninstall.adoc | 117 ++++++++++++++++++ modules/compliance-operator-uninstall.adoc | 10 +- .../compliance-operator-uninstallation.adoc | 4 +- 3 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 modules/compliance-operator-cli-uninstall.adoc diff --git a/modules/compliance-operator-cli-uninstall.adoc b/modules/compliance-operator-cli-uninstall.adoc new file mode 100644 index 0000000000..47625212d3 --- /dev/null +++ b/modules/compliance-operator-cli-uninstall.adoc @@ -0,0 +1,117 @@ +// Module included in the following assemblies: +// +// security/compliance_operator/compliance-operator-uninstallation.adoc + +:_content-type: PROCEDURE +[id="compliance-operator-uninstall-cli_{context}"] += Uninstalling the OpenShift Compliance Operator from {product-title} using the CLI + +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. + +.Prerequisites + +* Access to an {product-title} cluster using an account with `cluster-admin` permissions. +* The OpenShift Compliance Operator must be installed. + +.Procedure + +. Delete all objects in the namespace. + +.. Delete the `ScanSettingBinding` objects: ++ +[source,terminal] +---- +$ oc delete ssb -n openshift-compliance +---- + +.. Delete the `ScanSetting` objects: ++ +[source,terminal] +---- +$ oc delete ss -n openshift-compliance +---- + +.. Delete the `ComplianceSuite` objects: ++ +[source,terminal] +---- +$ oc delete suite -n openshift-compliance +---- + +.. Delete the `ComplianceScan` objects: ++ +[source,terminal] +---- +$ oc delete scan -n openshift-compliance +---- + +.. Obtain the `ProfileBundle` objects: ++ +[source,terminal] +---- +$ oc get profilebundle.compliance -n openshift-compliance +---- ++ +.Example output +[source,terminal] +---- +NAME CONTENTIMAGE CONTENTFILE STATUS +ocp4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256: ssg-ocp4-ds.xml VALID +rhcos4 registry.redhat.io/compliance/openshift-compliance-content-rhel8@sha256: ssg-rhcos4-ds.xml VALID +---- + +.. Delete the `ProfileBundle` objects: ++ +[source,terminal] +---- +$ oc delete profilebundle.compliance ocp4 rhcos4 -n openshift-compliance +---- ++ +.Example output +[source,terminal] +---- +profilebundle.compliance.openshift.io "ocp4" deleted +profilebundle.compliance.openshift.io "rhcos4" deleted +---- + +. Delete the Subscription object: ++ +[source,terminal] +---- +$ oc delete sub -n openshift-compliance +---- + +. Delete the CSV object: ++ +[source,terminal] +---- +$ oc delete CSV -n openshift-compliance +---- + +. Delete the project: ++ +[source,terminal] +---- +$ oc delete project -n openshift-compliance +---- ++ +.Example output +[source,terminal] +---- +project.project.openshift.io "openshift-compliance" deleted +---- + +.Verification + +. Confirm the namespace is deleted: ++ +[source,terminal] +---- +$ oc get project/openshift-compliance +---- ++ +.Example output +[source,terminal] +---- +Error from server (NotFound): namespaces "openshift-compliance" not found +---- \ No newline at end of file diff --git a/modules/compliance-operator-uninstall.adoc b/modules/compliance-operator-uninstall.adoc index 8e8f79e83d..d45269360b 100644 --- a/modules/compliance-operator-uninstall.adoc +++ b/modules/compliance-operator-uninstall.adoc @@ -4,9 +4,9 @@ :_content-type: PROCEDURE [id="compliance-operator-uninstall_{context}"] -= Uninstalling the OpenShift Compliance Operator from {product-title} += Uninstalling the OpenShift Compliance Operator from {product-title} using the web console -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. +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. .Prerequisites @@ -17,9 +17,11 @@ To remove the Compliance Operator, you must first delete the Compliance Operator To remove the Compliance Operator by using the {product-title} web console: -. Navigate to the *Operators* -> *Installed Operators* page. +. Go to the *Operators* -> *Installed Operators* -> *Compliance Operator* page. -. Delete all ScanSettingBinding, ComplainceSuite, ComplianceScan, and ProfileBundle objects. +.. Click *All instances*. + +.. In *All namespaces*, click the Options menu {kebab} and delete all ScanSettingBinding, ComplainceSuite, ComplianceScan, and ProfileBundle objects. . Switch to the *Administration* -> *Operators* -> *Installed Operators* page. diff --git a/security/compliance_operator/compliance-operator-uninstallation.adoc b/security/compliance_operator/compliance-operator-uninstallation.adoc index a5ad7ea8e0..38f7718d73 100644 --- a/security/compliance_operator/compliance-operator-uninstallation.adoc +++ b/security/compliance_operator/compliance-operator-uninstallation.adoc @@ -6,6 +6,8 @@ include::_attributes/common-attributes.adoc[] toc::[] -You can remove the OpenShift Compliance Operator from your cluster by using the {product-title} web console. +You can remove the OpenShift Compliance Operator from your cluster by using the {product-title} web console or the CLI. include::modules/compliance-operator-uninstall.adoc[leveloffset=+1] + +include::modules/compliance-operator-cli-uninstall.adoc[leveloffset=+1] \ No newline at end of file