From a57a64781a6fb5d27c73d3fe10d864c68a0465d5 Mon Sep 17 00:00:00 2001 From: Whit Morriss Date: Wed, 22 Apr 2015 09:31:45 -0500 Subject: [PATCH] scripting tweaks - use absolute path for kube_root (fixes JUJU_REPOSITORY directory creation issue) - shortcircuit status polling (for rerunning kubeup) - more granular polling iterations --- cluster/juju/util.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cluster/juju/util.sh b/cluster/juju/util.sh index 1e2065fd81..1ba5fa2de4 100755 --- a/cluster/juju/util.sh +++ b/cluster/juju/util.sh @@ -19,9 +19,11 @@ set -o errexit set -o nounset set -o pipefail +KUBE_ROOT=$(readlink -f $KUBE_ROOT) source $KUBE_ROOT/cluster/juju/prereqs/ubuntu-juju.sh export JUJU_REPOSITORY=${KUBE_ROOT}/cluster/juju/charms #KUBE_BUNDLE_URL='https://raw.githubusercontent.com/whitmo/bundle-kubernetes/master/bundles.yaml' + KUBE_BUNDLE_PATH=${KUBE_ROOT}/cluster/juju/bundles/local.yaml function verify-prereqs() { gather_installation_reqs @@ -103,10 +105,17 @@ function sleep-status(){ maxtime=900 jujustatus='' echo "Waiting up to 15 minutes to allow the cluster to come online... wait for it..." + + jujustatus=$(juju status kubernetes-master --format=oneline) + if [[ $jujustatus == *"started"* ]]; + then + return + fi + while [[ $i < $maxtime && $jujustatus != *"started"* ]]; do + sleep 15 + i+=15 jujustatus=$(juju status kubernetes-master --format=oneline) - sleep 30 - i+=30 done # sleep because we cannot get the status back of where the minions are in the deploy phase