diff --git a/ods_ci/tasks/Resources/Provisioning/Hive/deprovision.robot b/ods_ci/tasks/Resources/Provisioning/Hive/deprovision.robot deleted file mode 100644 index f50d5b7d0..000000000 --- a/ods_ci/tasks/Resources/Provisioning/Hive/deprovision.robot +++ /dev/null @@ -1,72 +0,0 @@ -*** Settings *** -Documentation Set of keywords to handle self-managed cluster deprovisioning -Library OperatingSystem -Library OpenShiftLibrary - - -*** Keywords *** -Set Hive Default Variables - ${cluster_name} = Get Variable Value ${cluster_name} %{TEST_CLUSTER} - Set Suite Variable ${cluster_name} - ${pool_name} = Get Variable Value ${pool_name} ${cluster_name}-pool - Set Suite Variable ${pool_name} - ${claim_name} = Get Variable Value ${claim_name} ${cluster_name}-claim - Set Suite Variable ${claim_name} - ${conf_name} = Get Variable Value ${conf_name} ${cluster_name}-conf - Set Suite Variable ${conf_name} - ${hive_namespace} = Get Variable Value ${hive_namespace} %{HIVE_NAMESPACE} - Set Suite Variable ${hive_namespace} - -Delete Cluster Configuration - IF ${use_cluster_pool} - Log Deleting cluster ${cluster_name} configuration console=True - @{Delete_Cluster} = Oc Delete kind=ClusterPool name=${pool_name} - ... namespace=${hive_namespace} api_version=hive.openshift.io/v1 - Log Many @{Delete_Cluster} - ${Delete_Cluster} = Oc Delete kind=ClusterDeploymentCustomization name=${conf_name} - ... namespace=${hive_namespace} api_version=hive.openshift.io/v1 - Log Many @{Delete_Cluster} - ELSE - ${Delete_Cluster} = Oc Delete kind=ClusterDeployment name=${cluster_name} - ... namespace=${hive_namespace} api_version=hive.openshift.io/v1 - ${rc} ${out} = Run And Return Rc And Output oc wait --for=delete cd/${cluster_name} --timeout 600s - Should Be Equal As Integers ${rc} ${0} ${out} - IF "${provider_type}" == "IBM" - Oc Delete kind=Secret name=${cluster_name}-manifests namespace=${hive_namespace} - ${rc} ${srv_ids} = Run And Return Rc And Output - ... ibmcloud iam service-ids --output json | jq -c '.[] | select(.name | contains("${cluster_name}-openshift-")) | .name' | tr -d '"' # robocop: disable:line-too-long - Should Be Equal As Integers ${rc} ${0} msg=${srv_ids} - ${srv_ids} = Split To Lines ${srv_ids} - FOR ${index} ${srv} IN ENUMERATE @{srv_ids} - Log ${index}: ${srv} - ${rc} ${out} = Run And Return Rc And Output ibmcloud iam service-id-delete ${srv} -f - Should Be Equal As Integers ${rc} ${0} msg=${out} - END - IF len($srv_ids) == 0 - Log message=no Service IDs found on IBM Cloud corresponding to ${cluster_name} cluster. Please check. - ... level=WARN - END - END - END - -Deprovision Cluster - IF ${use_cluster_pool} - ${cluster_claim} = Run Keyword And Return Status - ... Unclaim Cluster ${claim_name} - ELSE - ${cluster_claim} = Set Variable ${FALSE} - END - ${cluster_deprovision} = Run Keyword And Return Status - ... Delete Cluster Configuration - IF ${use_cluster_pool} == True and ${cluster_claim} == False - ... Log Cluster Claim ${claim_name} does not exists. Deleting Configuration console=True - IF ${cluster_deprovision} == False - ... Log Cluster ${cluster_name} has not been deleted. Please do it manually console=True - ... level=ERROR - Log Cluster ${cluster_name} has been deprovisioned console=True - -Unclaim Cluster - [Arguments] ${unclaimname} - Oc Delete kind=ClusterClaim name=${unclaimname} namespace=${hive_namespace} - ${status} = Oc Get kind=ClusterClaim name=${unclaimname} namespace=${hive_namespace} - Log ${status} console=True diff --git a/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot b/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot index 9e3ab0511..45786501c 100644 --- a/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot +++ b/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot @@ -1,5 +1,4 @@ *** Settings *** -Resource deprovision.robot Resource ../../../../tests/Resources/Common.robot Library Process @@ -72,9 +71,7 @@ Handle Already Existing Cluster ${result} = Run Process oc -n ${hive_namespace} get cd ${cluster_name} -o json | jq -r '.status.webConsoleURL' --exit-status shell=yes # robocop: disable:line-too-long END IF ${result.rc} != 0 - Log Cluster '${cluster_name}' has previously failed to be provisioned - Cleaning Hive resources - ... console=True - Delete Cluster Configuration + FAIL Cluster '${cluster_name}' has previously failed to be provisioned but some Hive and/or Cloud resources are still present. ELSE FAIL Cluster '${cluster_name}' is already in use, please choose a different name. END @@ -210,9 +207,8 @@ Wait For Cluster To Be Ready ${provision_status} = Run Process oc -n ${pool_namespace} get cd ${clusterdeployment_name} -o json shell=yes # robocop: disable:line-too-long ${custer_status} = Run Process oc -n ${hive_namespace} get clusterclaim ${claim_name} -o json shell=yes Log Cluster '${cluster_name}' deployment had errors, see: ${\n}${provision_status.stdout}${\n}${custer_status.stdout} level=ERROR # robocop: disable:line-too-long - Log Cluster '${cluster_name}' install completed, but it is not accessible - Cleaning Hive resources now + Log Cluster '${cluster_name}' install completed, but it is not accessible ... console=True - Deprovision Cluster FAIL Cluster '${cluster_name}' provisioning failed. Please look into the logs for more details. END Log Cluster '${cluster_name}' install completed and accessible at: ${web_access.stdout} console=True diff --git a/ods_ci/tasks/Tasks/provision_self_managed_cluster.robot b/ods_ci/tasks/Tasks/provision_self_managed_cluster.robot index 657d23482..7f9b12234 100644 --- a/ods_ci/tasks/Tasks/provision_self_managed_cluster.robot +++ b/ods_ci/tasks/Tasks/provision_self_managed_cluster.robot @@ -6,7 +6,6 @@ Documentation Provision Self-Managed clusters for testing. The cluster provis Metadata provision Resource ../../tests/Resources/Common.robot Resource ../Resources/Provisioning/Hive/provision.robot -Resource ../Resources/Provisioning/Hive/deprovision.robot Resource ../Resources/Provisioning/Hive/gpu-provision.robot Resource ../Resources/Provisioning/Hive/disconnect.robot Library OperatingSystem @@ -38,14 +37,6 @@ Provision Self-Managed Cluster Login To Cluster Pass Execution Self-Managed Cluster ${cluster_name} provisionend successfully -Deprovision Self-Managed Cluster - [Documentation] Deprovision a self-managed cluster - [Tags] self_managed_deprovision - [Setup] Run Keywords Set Hive Default Variables - ... AND - ... Set ClusterPool Variables - Deprovision Cluster - Add GPU Node To Self-Managed AWS Cluster [Documentation] Add GPU node to self-managed cluster [Tags] gpu_node_aws_self_managed_provision