Fix pod that's looked for on kube up.

pull/6/head
Max Forbes 2015-04-01 17:23:00 -07:00
parent 3f2309ad15
commit 152a461f39
1 changed files with 5 additions and 4 deletions

View File

@ -46,7 +46,7 @@ function verify-prereqs {
echo "SDK can be downloaded from https://cloud.google.com/sdk/."
exit 1
fi
fi
fi
done
# update and install components as needed
if [[ "${KUBE_PROMPT_FOR_UPDATE}" != "y" ]]; then
@ -672,11 +672,12 @@ function kube-up {
# Basic sanity checking
local i
local rc # Capture return code without exiting because of errexit bash option
local pause_pod="google_containers/pause"
for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
# Make sure docker is installed and working.
local attempt=0
while true; do
echo -n Attempt "$(($attempt+1))" to check Docker on node "${MINION_NAMES[$i]}" ...
echo -n Attempt "$(($attempt+1))" to check Docker and pause pod on node "${MINION_NAMES[$i]}" ...
local output=$(gcloud compute --project "${PROJECT}" ssh --zone "$ZONE" "${MINION_NAMES[$i]}" --command "sudo docker ps -a" 2>/dev/null)
if [[ -z "${output}" ]]; then
if (( attempt > 9 )); then
@ -686,10 +687,10 @@ function kube-up {
echo -e "cluster. (sorry!)${color_norm}" >&2
exit 1
fi
elif [[ "${output}" != *"kubernetes/pause"* ]]; then
elif [[ ! `echo "${output}" | grep "${pause_pod}"` ]]; then
if (( attempt > 9 )); then
echo
echo -e "${color_red}Failed to observe kubernetes/pause on node ${MINION_NAMES[$i]}. Your cluster is unlikely" >&2
echo -e "${color_red}Failed to observe ${pause_pod} on node ${MINION_NAMES[$i]}. Your cluster is unlikely" >&2
echo "to work correctly. Please run ./cluster/kube-down.sh and re-create the" >&2
echo -e "cluster. (sorry!)${color_norm}" >&2
exit 1