Skip to content

Commit 78931f4

Browse files
authored
HIVE-2792: Add Nutanix Prism Element name on IPI workflow (#62352)
1 parent 0c806e0 commit 78931f4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ci-operator/step-registry/ipi/conf/nutanix/context/ipi-conf-nutanix-context-commands.sh

+9
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@ clusters_json=$(curl -ks -u "${un}":"${pw}" -X POST ${api_ep} -H "Content-Type:
4545
# For QE nutanix with multi zone, we need to select PE by host IP
4646
if [[ $LEASED_RESOURCE =~ "nutanix-qe" ]]; then
4747
pe_uuid=$(echo "${clusters_json}" | jq ".entities[] | select (.spec.resources.network.external_ip == \"${prism_element_host}\") | .metadata.uuid" | head -n 1)
48+
pe_name=$(echo "${clusters_json}" | jq ".entities[] | select (.spec.resources.network.external_ip == \"${prism_element_host}\") | .spec.name" | head -n 1)
4849
else
4950
pe_uuid=$(echo "${clusters_json}" | jq '.entities[] | select (.spec.name != "Unnamed") | .metadata.uuid' | head -n 1)
51+
pe_name=$(echo "${clusters_json}" | jq -r '.entities[] | select (.spec.name != "Unnamed") | .spec.name' | head -n 1)
52+
fi
53+
54+
55+
if [[ -z "${pe_name}" ]]; then
56+
echo "$(date -u --rfc-3339=seconds) - Cannot get PE Name"
57+
exit 1
5058
fi
5159

5260
if [[ -z "${pe_uuid}" ]]; then
@@ -116,6 +124,7 @@ export PE_PORT='${prism_element_port}'
116124
export PE_USERNAME='${prism_element_username}'
117125
export PE_PASSWORD='${prism_element_password}'
118126
export PE_UUID='${pe_uuid}'
127+
export PE_NAME='${pe_name}'
119128
export PE_STORAGE_CONTAINER='${prism_element_storage_container}'
120129
export SUBNET_UUID='${subnet_uuid}'
121130
export API_VIP='${API_VIP}'

0 commit comments

Comments
 (0)