From 0357f31b86578cc99a834200d73c105100eb8970 Mon Sep 17 00:00:00 2001 From: Kobi Hakimi Date: Wed, 13 Mar 2024 16:14:00 +0200 Subject: [PATCH] update the hive workaround to support the new hive related to jira ticket: RHOAIENG-3338 Signed-off-by: Kobi Hakimi --- .../Resources/Provisioning/Hive/provision.robot | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot b/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot index 6eb40278f..c6c58e016 100644 --- a/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot +++ b/ods_ci/tasks/Resources/Provisioning/Hive/provision.robot @@ -10,7 +10,7 @@ Claim Cluster Does ClusterName Exists @{clusterpoolname} = Oc Get kind=ClusterPool namespace=${hive_namespace} api_version=hive.openshift.io/v1 Log Many @{clusterpoolname} - Log Many ${cluster_name} + Log Many ${cluster_name} FOR ${name} IN @{clusterpoolname} IF "${name}[metadata][name]" == "${pool_name}" Log ${name}[metadata][name] console=True @@ -58,7 +58,7 @@ Create Provider Resources ELSE FAIL Invalid provider name END - + Select Provisioner Template [Arguments] ${provider_type} IF "${provider_type}" == "AWS" @@ -74,7 +74,7 @@ Select Provisioner Template FAIL Invalid provider name END RETURN ${template} - + Create Openstack Resources Log Creating OSP resources in Cloud '${infrastructure_configurations}[osp_cloud_name]' console=True ${result} Run Process echo '${infrastructure_configurations}[osp_cloud_name]' | base64 -w0 shell=yes @@ -102,7 +102,7 @@ Create Floating IPs File Should Not Be Empty ${osp_clouds_yaml} ${shell_script} = Catenate ... ${CURDIR}/OSP/create_fips.sh ${cluster_name} ${infrastructure_configurations}[base_domain] - ... ${infrastructure_configurations}[osp_network] ${infrastructure_configurations}[osp_cloud_name] ${artifacts_dir}/ + ... ${infrastructure_configurations}[osp_network] ${infrastructure_configurations}[osp_cloud_name] ${artifacts_dir}/ ${return_code} = Run and Watch Command ${shell_script} output_should_contain=Exporting Floating IPs Should Be Equal As Integers ${return_code} 0 msg=Error creating floating IPs for cluster '${cluster_name}' ${fips_file_to_export} = Set Variable @@ -159,9 +159,10 @@ Wait For Cluster To Be Ready ${claim_status} = Run Process ... oc -n ${hive_namespace} wait --for\=condition\=ClusterRunning\=True clusterclaim ${claim_name} --timeout\=10m shell=yes # robocop: disable:line-too-long # Workaround for old Hive with Openstack - Cluster is displayed as Resuming even when it is Running + # add also support to the new Hive where the Cluster is displayed as Running IF "${provider_type}" == "OSP" - ${claim_status} = Run Process - ... oc -n ${hive_namespace} get clusterclaim ${claim_name} -o json | jq '.status.conditions[] | select(.type\=\="ClusterRunning" and .reason\=\="Resuming")' --exit-status shell=yes + ${claim_status} = Run Process + ... oc -n ${hive_namespace} get clusterclaim ${claim_name} -o json | jq '.status.conditions[] | select(.type\=\="ClusterRunning" and (.reason\=\="Resuming" or .reason\=\="Running"))' --exit-status shell=yes END IF ${provision_status.rc} != 0 or ${web_access.rc} != 0 or ${claim_status.rc} != 0 ${provision_status} = Run Process oc -n ${pool_namespace} get cd ${pool_namespace} -o json shell=yes @@ -173,7 +174,7 @@ Wait For Cluster To Be Ready 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 - + Save Cluster Credentials Set Task Variable ${cluster_details} ${artifacts_dir}/${cluster_name}_details.txt Set Task Variable ${cluster_kubeconf} ${artifacts_dir}/kubeconfig @@ -196,7 +197,7 @@ Save Cluster Credentials ... shell=yes Should Be True ${result.rc} == 0 RETURN ${cluster_kubeconf} - + Login To Cluster Export Variables From File ${cluster_details} Create File ${cluster_kubeconf}