Skip to content

Commit 590af98

Browse files
committed
Nutanix e2e
1 parent 5c1fb87 commit 590af98

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

hack/e2e-common.sh

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,35 @@ CLUSTER_PROFILE_DIR="${CLUSTER_PROFILE_DIR:-/tmp/cluster}"
9494
CLOUD="${CLOUD:-aws}"
9595
export ARTIFACT_DIR="${ARTIFACT_DIR:-/tmp}"
9696

97+
if [[ "${CLOUD}" == "nutanix" ]]; then
98+
if [[ -z "${SHARED_DIR}" ]]; then
99+
echo "Variable 'SHARED_DIR' not set."
100+
exit 1
101+
fi
102+
103+
NUTANIX_MANIFESTS_DIR="${SHARED_DIR}/hive-manifests"
104+
if ! mkdir -p "${NUTANIX_MANIFESTS_DIR}"; then
105+
echo "Failed to create manifests directory '${NUTANIX_MANIFESTS_DIR}'"
106+
exit 1
107+
fi
108+
109+
files_found=0
110+
while IFS= read -r -d '' item; do
111+
((files_found++))
112+
manifest="$(basename "${item}")"
113+
if ! cp "${item}" "${NUTANIX_MANIFESTS_DIR}/${manifest##manifest_}"; then
114+
echo "Warning: Failed to copy '${item}' to '${NUTANIX_MANIFESTS_DIR}/${manifest##manifest_}'"
115+
((files_found--))
116+
fi
117+
done < <(find "${SHARED_DIR}" \( -name "manifest_*.yml" -o -name "manifest_*.yaml" \) -size +0c -print0)
118+
119+
if [[ $files_found -eq 0 ]]; then
120+
echo "No non-empty manifest files found in ${SHARED_DIR}"
121+
exit 1
122+
fi
123+
echo "Found and successfully copied ${files_found} non-empty manifest files from ${SHARED_DIR} to ${NUTANIX_MANIFESTS_DIR}"
124+
fi
125+
97126
SSH_PUBLIC_KEY_FILE="${SSH_PUBLIC_KEY_FILE:-${CLUSTER_PROFILE_DIR}/ssh-publickey}"
98127
# If not specified or nonexistent, generate a keypair to use
99128
if ! [[ -s "${SSH_PUBLIC_KEY_FILE}" ]]; then
@@ -257,20 +286,22 @@ case "${CLOUD}" in
257286
--vsphere-ingress-vip=$VSPHERE_INGRESS_VIP"
258287
;;
259288
"nutanix")
260-
261289
USE_MANAGED_DNS=false
290+
CREDS_FILE_ARG="--creds-file=${SHARED_DIR}/credentials"
291+
BASE_DOMAIN="${BASE_DOMAIN:-nutanix-ci.devcluster.openshift.com}"
262292
EXTRA_CREATE_CLUSTER_ARGS="--nutanix-pc-address=${NUTANIX_HOST} \
263293
--nutanix-pc-port=${NUTANIX_PORT:-9440} \
264294
--nutanix-pe-address=${PE_HOST} \
265295
--nutanix-pe-port=${PE_PORT:-9440} \
266-
--nutanix-ca-certs=${NUTANIX_CERT:-}
296+
--nutanix-ca-certs=${NUTANIX_CERT:-} \
267297
--nutanix-pe-uuid=${PE_UUID} \
268298
--nutanix-pe-name=${PE_NAME} \
269299
--nutanix-subnetUUIDs=${SUBNET_UUID} \
270-
--nutanix-az-name=${NUTANIX_AZ_NAME-Local_AZ} \
271-
--manifests=${MANIFESTS} \
272-
--nutanix-api-vip=$API_VIP \
273-
--nutanix-ingress-vip=$INGRESS_VIP"
300+
--nutanix-az-name=${NUTANIX_AZ_NAME:-Local_AZ} \
301+
--manifests=${NUTANIX_MANIFESTS_DIR} \
302+
--credentials-mode-manual \
303+
--nutanix-api-vip=$HIVE_API_VIP \
304+
--nutanix-ingress-vip=$HIVE_INGRESS_VIP"
274305
;;
275306
"openstack")
276307
CREDS_FILE_ARG="--creds-file=${SHARED_DIR}/clouds.yaml"

0 commit comments

Comments
 (0)