Skip to content

Commit

Permalink
update the hive workaround to support the new hive
Browse files Browse the repository at this point in the history
related to jira ticket: RHOAIENG-3338

Signed-off-by: Kobi Hakimi <[email protected]>
  • Loading branch information
kobihk committed Mar 13, 2024
1 parent 937fdbf commit 0357f31
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}/

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning

Line is too long (123/120)
${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

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning

Line is too long (217/120)
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 0357f31

Please sign in to comment.