Skip to content

Commit a3ef31d

Browse files
committed
fix: use cleanup.sh script to uninstall in sm clusters
1 parent d47c4e7 commit a3ef31d

File tree

1 file changed

+5
-59
lines changed

1 file changed

+5
-59
lines changed

ods_ci/tasks/Resources/RHODS_OLM/uninstall/uninstall.robot

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,17 @@ Uninstalling RHODS Operator
2121
... Uninstall RHODS
2222

2323
Uninstall RHODS
24-
${new_operator} = Is RHODS Version Greater Or Equal Than 2.0.0
25-
IF "${cluster_type}" == "managed" and ${new_operator} == $False
24+
IF "${cluster_type}" == "managed"
2625
Uninstall RHODS In OSD
27-
ELSE IF "${cluster_type}" == "selfmanaged" and ${new_operator} == $False
26+
ELSE IF "${cluster_type}" == "selfmanaged"
2827
Uninstall RHODS In Self Managed Cluster
29-
ELSE IF ${new_operator}
30-
Uninstall RHODS V2
3128
ELSE
3229
Fail Kindly provide supported cluster type
3330
END
3431

3532
Uninstall RHODS In OSD
3633
Clone OLM Install Repo
37-
${return_code} ${output} Run And Return Rc And Output cd ${EXECDIR}/${OLM_DIR} && ./cleanup.sh -t addon #robocop:disable
34+
${return_code} ${output} Run And Return Rc And Output cd ${EXECDIR}/${OLM_DIR} && ./cleanup.sh -t addon -k #robocop:disable
3835
Should Be Equal As Integers ${return_code} 0 msg=Error detected while un-installing RHODS
3936
Log To Console ${output}
4037

@@ -45,7 +42,7 @@ Uninstall RHODS In Self Managed Cluster
4542
ELSE IF "${INSTALL_TYPE}" == "OperatorHub"
4643
Uninstall RHODS In Self Managed Cluster For Operatorhub
4744
ELSE
48-
FAIL Provided install type is not supported
45+
FAIL Provided install type is not supported
4946
END
5047

5148
RHODS Operator Should Be Uninstalled
@@ -55,7 +52,7 @@ RHODS Operator Should Be Uninstalled
5552
Uninstall RHODS In Self Managed Cluster Using CLI
5653
[Documentation] UnInstall rhods on self-managedcluster using cli
5754
Clone OLM Install Repo
58-
${return_code} Run and Watch Command cd ${EXECDIR}/${OLM_DIR} && ./cleanup.sh -t operator timeout=10 min
55+
${return_code} Run and Watch Command cd ${EXECDIR}/${OLM_DIR} && ./cleanup.sh -t operator -k timeout=10 min
5956
Should Be Equal As Integers ${return_code} 0 msg=Error detected while un-installing RHODS
6057

6158
Uninstall RHODS In Self Managed Cluster For Operatorhub
@@ -69,57 +66,6 @@ Uninstall RHODS In Self Managed Cluster For Operatorhub
6966
Verify Project Does Not Exists ${NOTEBOOKS_NAMESPACE}
7067
${return_code} ${output} Run And Return Rc And Output oc delete namespace ${OPERATOR_NAMESPACE}
7168

72-
Uninstall RHODS V2
73-
[Documentation] Keyword to uninstall the version 2 of the RHODS operator in Self-Managed
74-
Log To Console message=Deleting DSC CR From Cluster
75-
${return_code} ${output} Run And Return Rc And Output
76-
... oc get DataScienceCluster --all-namespaces -o custom-columns=:metadata.name --ignore-not-found | xargs -I {} oc patch DataScienceCluster {} --type=merge -p '{"metadata": {"finalizers":null}}' || true #robocop:disable
77-
${return_code} ${output} Run And Return Rc And Output
78-
... oc delete datasciencecluster --all --ignore-not-found
79-
Should Be Equal As Integers ${return_code} 0 msg=Error deleting DataScienceCluster CR
80-
Log To Console message=Deleting DSCi CR From Cluster
81-
${return_code} ${output} Run And Return Rc And Output
82-
... oc get DSCInitialization --all-namespaces -o custom-columns=:metadata.name --ignore-not-found | xargs -I {} oc patch DSCInitialization {} --type=merge -p '{"metadata": {"finalizers":null}}' || true #robocop:disable
83-
${return_code} ${output} Run And Return Rc And Output
84-
... oc delete dscinitialization --all --ignore-not-found
85-
Should Be Equal As Integers ${return_code} 0 msg=Error deleting DSCInitialization CR
86-
Log To Console message=Deleting Operator Subscription From Cluster
87-
${return_code} ${subscription_name} Run And Return Rc And Output
88-
... oc get subscription -n ${OPERATOR_NAMESPACE} --no-headers | awk '{print $1}'
89-
IF "${return_code}" == "0" and "${subscription_name}" != "${EMPTY}"
90-
${return_code} ${csv_name} Run And Return Rc And Output
91-
... oc get subscription ${subscription_name} -n ${OPERATOR_NAMESPACE} -ojson | jq '.status.currentCSV' | tr -d '"'
92-
IF "${return_code}" == "0" and "${csv_name}" != "${EMPTY}"
93-
${return_code} ${output} Run And Return Rc And Output
94-
... oc delete clusterserviceversion ${csv_name} -n ${OPERATOR_NAMESPACE} --ignore-not-found
95-
Should Be Equal As Integers ${return_code} 0 msg=Error deleting RHODS CSV ${csv_name}
96-
END
97-
${return_code} ${output} Run And Return Rc And Output
98-
... oc delete subscription ${subscription_name} -n ${OPERATOR_NAMESPACE} --ignore-not-found
99-
Should Be Equal As Integers ${return_code} 0 msg=Error deleting RHODS subscription
100-
END
101-
Log To Console message=Deleting Operator CSV From Cluster
102-
${return_code} ${output} Run And Return Rc And Output
103-
... oc delete clusterserviceversion opendatahub-operator.1.18.0 -n openshift-operators --ignore-not-found
104-
Log To Console message=Deleting Operator Catalog From Cluster
105-
${return_code} ${output} Run And Return Rc And Output
106-
... oc delete CatalogSource rhoai-catalog-dev -n openshift-marketplace --ignore-not-found # robocop: disable
107-
${return_code} ${output} Run And Return Rc And Output
108-
... oc delete CatalogSource addon-managed-odh-catalog -n openshift-marketplace --ignore-not-found # robocop: disable
109-
Log To Console message=Deleting Operator Group From Cluster
110-
${return_code} ${output} Run And Return Rc And Output
111-
... oc delete operatorgroup --all -n ${OPERATOR_NAMESPACE} --ignore-not-found
112-
Should Be Equal As Integers ${return_code} 0 msg=Error deleting operatorgroup
113-
Log To Console message=Deleting Operator and it's associate namepsace
114-
${return_code} ${output} Run And Return Rc And Output oc delete ns -l opendatahub.io/generated-namespace --ignore-not-found
115-
Verify Project Does Not Exists ${APPLICATIONS_NAMESPACE}
116-
Verify Project Does Not Exists ${MONITORING_NAMESPACE}
117-
Verify Project Does Not Exists ${NOTEBOOKS_NAMESPACE}
118-
IF "${OPERATOR_NAMESPACE}" != "openshift-marketplace"
119-
${return_code} ${output} Run And Return Rc And Output oc delete namespace ${OPERATOR_NAMESPACE} --ignore-not-found
120-
Verify Project Does Not Exists ${OPERATOR_NAMESPACE}
121-
END
122-
12369
Uninstall Service Mesh Operator CLI
12470
[Documentation] Keyword to uninstall the Service Mesh Operator
12571
Log To Console message=Deleting ServiceMeshControlPlane CR From Cluster

0 commit comments

Comments
 (0)