Fix update.sh

pull/6/head
Brendan Burns 2015-01-28 16:53:02 -08:00
parent 668d8539b8
commit 9f5ca3f6ac
2 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ if [[ "${DOCKER_HUB_USER+set}" != "set" ]] ; then
exit 1
fi
export KUBE_ROOT=$(dirname $0)/../..
export KUBE_REPO_ROOT=${KUBE_REPO_ROOT-$(dirname $0)/../..}
export KUBECTL=${KUBE_REPO_ROOT}/cluster/kubectl.sh
set -x

View File

@ -34,7 +34,7 @@ function validate() {
# Container turn up on a clean cluster can take a while for the docker image pull.
local num_running=0
local i=0
while [[ ${num_running} -ne ${num_replicas} && ${i} -ne 100]]; do
while [[ ${num_running} -ne ${num_replicas} && ${i} -ne 100 ]]; do
((i++)) || true
echo "Waiting for all containers in pod to come up. Currently: ${num_running}/${num_replicas}"
sleep 2
@ -62,7 +62,7 @@ function validate() {
# This template is unit-tested in kubec{tl|fg}, so if you change it, update the unit test.
#
# You can read about the syntax here: http://golang.org/pkg/text/template/
template_string="{{and (exists . \"currentState\" \"info\" \"${CONTROLLER_NAME}\" \"state\" \"running\") (exists . \"currentState\" \"info\" \"net\" \"state\" \"running\")}}"
template_string="{{and (exists . \"currentState\" \"info\" \"${CONTROLLER_NAME}\" \"state\" \"running\") (exists . \"currentState\" \"info\" \"POD\" \"state\" \"running\")}}"
current_status=$($KUBECTL get pods "$id" -o template --template="${template_string}") || {
if [[ $current_status =~ "pod \"${id}\" not found" ]]; then
echo " $id no longer exists"
@ -106,9 +106,6 @@ function validate() {
export DOCKER_HUB_USER=jlowdermilk
# Launch a container
${KUBE_ROOT}/examples/update-demo/2-create-replication-controller.sh
function teardown() {
echo "Cleaning up test artifacts"
${KUBE_ROOT}/examples/update-demo/5-down.sh
@ -116,6 +113,9 @@ function teardown() {
trap "teardown" EXIT
# Launch a container
${KUBE_ROOT}/examples/update-demo/2-create-replication-controller.sh
validate 2 nautilus
${KUBE_ROOT}/examples/update-demo/3-scale.sh 1