From 7fbbded9424fa6b408074f5a9629b3670c097890 Mon Sep 17 00:00:00 2001 From: Brendan Melville Date: Wed, 18 Nov 2015 14:18:52 -0800 Subject: [PATCH 1/3] bootstrap.sh should look for the namespace file local to the script. --- examples/bootstrap/bootstrap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/bootstrap/bootstrap.sh b/examples/bootstrap/bootstrap.sh index a1b2776fa..91b17f555 100755 --- a/examples/bootstrap/bootstrap.sh +++ b/examples/bootstrap/bootstrap.sh @@ -42,7 +42,9 @@ $MANAGER > $LOGDIR/manager.log 2>&1 --port=8080 --expanderURL=http://localhost:8 echo echo "Creating dm namespace..." -$KUBECTL create -f dm-namespace.yaml +BOOTSTRAP_PATH=$( cd $(dirname $0) ; pwd -P ) +$KUBECTL delete -f $BOOTSTRAP_PATH/dm-namespace.yaml +$KUBECTL create -f $BOOTSTRAP_PATH/dm-namespace.yaml echo echo "Starting kubectl proxy..." From c84b2873dfa97074bff98f39c13b3f733eb407fd Mon Sep 17 00:00:00 2001 From: Brendan Melville Date: Wed, 18 Nov 2015 15:25:28 -0800 Subject: [PATCH 2/3] Never delete the namespace for bootstrap, but check before creating. --- examples/bootstrap/bootstrap.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/bootstrap/bootstrap.sh b/examples/bootstrap/bootstrap.sh index 91b17f555..97576a625 100755 --- a/examples/bootstrap/bootstrap.sh +++ b/examples/bootstrap/bootstrap.sh @@ -42,9 +42,11 @@ $MANAGER > $LOGDIR/manager.log 2>&1 --port=8080 --expanderURL=http://localhost:8 echo echo "Creating dm namespace..." -BOOTSTRAP_PATH=$( cd $(dirname $0) ; pwd -P ) -$KUBECTL delete -f $BOOTSTRAP_PATH/dm-namespace.yaml -$KUBECTL create -f $BOOTSTRAP_PATH/dm-namespace.yaml +$KUBECTL get namespace dm >/dev/null 2>/dev/null +if [ $? -ne 0 ]; then + BOOTSTRAP_PATH=$( cd $(dirname $0) ; pwd -P ) + $KUBECTL create -f $BOOTSTRAP_PATH/dm-namespace.yaml +fi echo echo "Starting kubectl proxy..." From 8c0da66e7ddafdadd8d75a07ce4afe4269d575cc Mon Sep 17 00:00:00 2001 From: Brendan Melville Date: Wed, 18 Nov 2015 14:18:52 -0800 Subject: [PATCH 3/3] bootstrap.sh should look for the namespace file local to the script. Never delete the namespace for bootstrap, but check before creating. --- examples/bootstrap/bootstrap.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/bootstrap/bootstrap.sh b/examples/bootstrap/bootstrap.sh index a1b2776fa..97576a625 100755 --- a/examples/bootstrap/bootstrap.sh +++ b/examples/bootstrap/bootstrap.sh @@ -42,7 +42,11 @@ $MANAGER > $LOGDIR/manager.log 2>&1 --port=8080 --expanderURL=http://localhost:8 echo echo "Creating dm namespace..." -$KUBECTL create -f dm-namespace.yaml +$KUBECTL get namespace dm >/dev/null 2>/dev/null +if [ $? -ne 0 ]; then + BOOTSTRAP_PATH=$( cd $(dirname $0) ; pwd -P ) + $KUBECTL create -f $BOOTSTRAP_PATH/dm-namespace.yaml +fi echo echo "Starting kubectl proxy..."