Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update the hive workaround to support the new hive #1287

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
ELSE
FAIL Invalid provider name
END

Select Provisioner Template
[Arguments] ${provider_type}
IF "${provider_type}" == "AWS"
Expand All @@ -74,7 +74,7 @@
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 @@
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 @@
${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 @@
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 @@
... 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
Loading