mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Test gcloud exit when detecting master for e2e
e2e tests set errexit, so without testing the exit status of a command its scripted error message will not be printed.
This commit is contained in:
parent
991afb2436
commit
83847eac79
@ -401,12 +401,12 @@ function detect-master() {
|
||||
if [[ -z "${KUBE_MASTER_IP-}" ]]; then
|
||||
local master_address_name="${MASTER_NAME}-ip"
|
||||
echo "Looking for address '${master_address_name}'" >&2
|
||||
KUBE_MASTER_IP=$(gcloud compute addresses describe "${master_address_name}" \
|
||||
--project "${PROJECT}" --region "${REGION}" -q --format='value(address)')
|
||||
fi
|
||||
if [[ -z "${KUBE_MASTER_IP-}" ]]; then
|
||||
echo "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'" >&2
|
||||
exit 1
|
||||
if ! KUBE_MASTER_IP=$(gcloud compute addresses describe "${master_address_name}" \
|
||||
--project "${PROJECT}" --region "${REGION}" -q --format='value(address)') || \
|
||||
[[ -z "${KUBE_MASTER_IP-}" ]]; then
|
||||
echo "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "Using master: $KUBE_MASTER (external IP: $KUBE_MASTER_IP)" >&2
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user