Report the found minions during validation of cluster

This commit is contained in:
Satnam Singh 2015-02-04 15:56:52 -08:00
parent d927049775
commit a57d4c593c

View File

@ -32,7 +32,8 @@ get-password
detect-master > /dev/null detect-master > /dev/null
detect-minions > /dev/null detect-minions > /dev/null
MINIONS_FILE=/tmp/minions MINIONS_FILE=/tmp/minions-$$
trap 'rm -rf "${MINIONS_FILE}"' EXIT
# Make several attempts to deal with slow cluster birth. # Make several attempts to deal with slow cluster birth.
attempt=0 attempt=0
while true; do while true; do
@ -43,6 +44,7 @@ while true; do
else else
if (( attempt > 5 )); then if (( attempt > 5 )); then
echo -e "${color_red}Detected ${found} nodes out of ${NUM_MINIONS}. Your cluster may not be working. ${color_norm}" echo -e "${color_red}Detected ${found} nodes out of ${NUM_MINIONS}. Your cluster may not be working. ${color_norm}"
cat -n "${MINIONS_FILE}"
exit 2 exit 2
fi fi
attempt=$((attempt+1)) attempt=$((attempt+1))
@ -50,7 +52,7 @@ while true; do
fi fi
done done
echo "Found ${found} nodes." echo "Found ${found} nodes."
cat "${MINIONS_FILE}" cat -n "${MINIONS_FILE}"
# On vSphere, use minion IPs as their names # On vSphere, use minion IPs as their names
if [[ "${KUBERNETES_PROVIDER}" == "vsphere" ]] || [[ "${KUBERNETES_PROVIDER}" == "vagrant" ]]; then if [[ "${KUBERNETES_PROVIDER}" == "vsphere" ]] || [[ "${KUBERNETES_PROVIDER}" == "vagrant" ]]; then
@ -62,6 +64,7 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
count=$(grep -c "${MINION_NAMES[$i]}" "${MINIONS_FILE}") || : count=$(grep -c "${MINION_NAMES[$i]}" "${MINIONS_FILE}") || :
if [[ "${count}" == "0" ]]; then if [[ "${count}" == "0" ]]; then
echo -e "${color_red}Failed to find ${MINION_NAMES[$i]}, cluster is probably broken.${color_norm}" echo -e "${color_red}Failed to find ${MINION_NAMES[$i]}, cluster is probably broken.${color_norm}"
cat -n "${MINIONS_FILE}"
exit 1 exit 1
fi fi