mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +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,13 +401,13 @@ function detect-master() {
|
|||||||
if [[ -z "${KUBE_MASTER_IP-}" ]]; then
|
if [[ -z "${KUBE_MASTER_IP-}" ]]; then
|
||||||
local master_address_name="${MASTER_NAME}-ip"
|
local master_address_name="${MASTER_NAME}-ip"
|
||||||
echo "Looking for address '${master_address_name}'" >&2
|
echo "Looking for address '${master_address_name}'" >&2
|
||||||
KUBE_MASTER_IP=$(gcloud compute addresses describe "${master_address_name}" \
|
if ! KUBE_MASTER_IP=$(gcloud compute addresses describe "${master_address_name}" \
|
||||||
--project "${PROJECT}" --region "${REGION}" -q --format='value(address)')
|
--project "${PROJECT}" --region "${REGION}" -q --format='value(address)') || \
|
||||||
fi
|
[[ -z "${KUBE_MASTER_IP-}" ]]; then
|
||||||
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
|
echo "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
echo "Using master: $KUBE_MASTER (external IP: $KUBE_MASTER_IP)" >&2
|
echo "Using master: $KUBE_MASTER (external IP: $KUBE_MASTER_IP)" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user