Merge pull request #7144 from brendandburns/ssh-exit

Fix the ssh-to-node to actually fail on failures.
pull/6/head
Brian Grant 2015-04-22 07:10:49 -07:00
commit ae3c83f804
2 changed files with 14 additions and 3 deletions

View File

@ -967,11 +967,15 @@ function test-teardown {
function ssh-to-node { function ssh-to-node {
local node="$1" local node="$1"
local cmd="$2" local cmd="$2"
# Loop until we can successfully ssh into the box
for try in $(seq 1 5); do for try in $(seq 1 5); do
if gcloud compute ssh --ssh-flag="-o LogLevel=quiet" --project "${PROJECT}" --zone="${ZONE}" "${node}" --command "${cmd}"; then if gcloud compute ssh --ssh-flag="-o LogLevel=quiet" --project "${PROJECT}" --zone="${ZONE}" "${node}" --command "echo test"; then
break break
fi fi
sleep 5
done done
# Then actually try the command.
gcloud compute ssh --ssh-flag="-o LogLevel=quiet" --project "${PROJECT}" --zone="${ZONE}" "${node}" --command "${cmd}"
} }
# Restart the kube-proxy on a node ($1) # Restart the kube-proxy on a node ($1)

View File

@ -238,8 +238,15 @@ function ssh-to-node() {
local node="$1" local node="$1"
local cmd="$2" local cmd="$2"
"${GCLOUD}" compute ssh --ssh-flag="-o LogLevel=quiet" --project "${PROJECT}" \ # Loop until we can successfully ssh into the box
--zone="${ZONE}" "${node}" --command "${cmd}" for try in $(seq 1 5); do
if gcloud compute ssh --ssh-flag="-o LogLevel=quiet" --project "${PROJECT}" --zone="${ZONE}" "${node}" --command "echo test"; then
break
fi
sleep 5
done
# Then actually try the command.
gcloud compute ssh --ssh-flag="-o LogLevel=quiet" --project "${PROJECT}" --zone="${ZONE}" "${node}" --command "${cmd}"
} }
# Restart the kube-proxy on a node ($1) # Restart the kube-proxy on a node ($1)