Skip to content

Commit

Permalink
Fix pod that's looked for on kube up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbforbes committed Apr 2, 2015
1 parent 3f2309a commit 152a461
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 152a461

Please sign in to comment.