Merge pull request #26441 from aanm/fixing-local-up-cluster-sh

Automatic merge from submit-queue

Add more global options to local-up-cluster.sh

I added a couple more global variables to the `local-up-cluster.sh` script.

The `KUBELET_HOST` environment name make sense to me. If it isn't the best name I will change it.

The `ETCD` ones make sense since they are being used under `hack/lib/etcd.sh`

Signed-off-by: André Martins <aanm90@gmail.com>
This commit is contained in:
k8s-merge-robot
2016-05-28 01:30:55 -07:00
2 changed files with 9 additions and 9 deletions

View File

@@ -17,11 +17,10 @@
# A set of helpers for starting/running etcd for tests
ETCD_VERSION=${ETCD_VERSION:-2.2.1}
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
ETCD_PORT=${ETCD_PORT:-4001}
kube::etcd::start() {
local host=${ETCD_HOST:-127.0.0.1}
local port=${ETCD_PORT:-4001}
which etcd >/dev/null || {
kube::log::usage "etcd must be in your PATH"
exit 1
@@ -42,13 +41,13 @@ kube::etcd::start() {
# Start etcd
ETCD_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t test-etcd.XXXXXX)
kube::log::info "etcd -data-dir ${ETCD_DIR} --bind-addr ${host}:${port} >/dev/null 2>/dev/null"
etcd -data-dir ${ETCD_DIR} --bind-addr ${host}:${port} >/dev/null 2>/dev/null &
kube::log::info "etcd -data-dir ${ETCD_DIR} --bind-addr ${ETCD_HOST}:${ETCD_PORT} >/dev/null 2>/dev/null"
etcd -data-dir ${ETCD_DIR} --bind-addr ${ETCD_HOST}:${ETCD_PORT} >/dev/null 2>/dev/null &
ETCD_PID=$!
echo "Waiting for etcd to come up."
kube::util::wait_for_url "http://${host}:${port}/v2/machines" "etcd: " 0.25 80
curl -fs -X PUT "http://${host}:${port}/v2/keys/_test"
kube::util::wait_for_url "http://${ETCD_HOST}:${ETCD_PORT}/v2/machines" "etcd: " 0.25 80
curl -fs -X PUT "http://${ETCD_HOST}:${ETCD_PORT}/v2/keys/_test"
}
kube::etcd::stop() {