From 9f5ca3f6ac2d4ca20ab5a66f00cadec26f7fb80a Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Wed, 28 Jan 2015 16:53:02 -0800 Subject: [PATCH] Fix update.sh --- .../update-demo/2-create-replication-controller.sh | 2 +- hack/e2e-suite/update.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/update-demo/2-create-replication-controller.sh b/examples/update-demo/2-create-replication-controller.sh index 77e27005a9..e70379899d 100755 --- a/examples/update-demo/2-create-replication-controller.sh +++ b/examples/update-demo/2-create-replication-controller.sh @@ -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 diff --git a/hack/e2e-suite/update.sh b/hack/e2e-suite/update.sh index d17de4b2e5..39eb69e377 100755 --- a/hack/e2e-suite/update.sh +++ b/hack/e2e-suite/update.sh @@ -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