Skip to content

Commit

Permalink
update the hive workaround to support the new hive (#1287)
Browse files Browse the repository at this point in the history
In the old Hive the cluster status was Resuming instead of Running so we
had the workaround to check that
In the new Hive this issue was fixed and the status is Running but to
support both we updated the workaround

verified with old Hive:
➜ oc -n rhods get clusterclaim ods-qe-psi-03-claim -o json | jq
'.status.conditions[] | select(.type=="ClusterRunning" and
(.reason=="Resuming" or .reason=="Running"))' --exit-status
{
  "lastProbeTime": "2024-03-05T17:38:34Z",
  "lastTransitionTime": "2024-03-05T17:38:34Z",
  "message": "Waiting for cluster to be running",
  "reason": "Resuming",
  "status": "False",
  "type": "ClusterRunning"
}
➜  

verified with the New Hive:
➜ oc -n rhoai get clusterclaim ods-qe-psi-04-claim -o json | jq
'.status.conditions[] | select(.type=="ClusterRunning" and
(.reason=="Resuming" or .reason=="Running"))' --exit-status
{
  "lastProbeTime": "2024-03-13T11:42:33Z",
  "lastTransitionTime": "2024-03-13T11:42:33Z",
  "message": "Cluster is running",
  "reason": "Running",
  "status": "True",
  "type": "ClusterRunning"
}
➜  


related to jira ticket: RHOAIENG-3338
  • Loading branch information
kobihk authored Mar 14, 2024
2 parents ac2e7a7 + b42c85e commit 6cb0617
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ods_ci/tasks/Resources/Provisioning/Hive/provision.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -58,7 +58,7 @@ Create Provider Resources
ELSE
FAIL Invalid provider name
END

Select Provisioner Template
[Arguments] ${provider_type}
IF "${provider_type}" == "AWS"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}
Expand Down

0 comments on commit 6cb0617

Please sign in to comment.