Skip to content

Commit d83aac4

Browse files
committed
Merge pull request #1938 from johanneswuerbach/fix-router-default-values
fix(router): Set default values in /deis/router
2 parents e6203bd + f7f00c1 commit d83aac4

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

router/bin/boot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ set -eo pipefail
1212
# configure etcd
1313
export ETCD_PORT=${ETCD_PORT:-4001}
1414
export ETCD="$HOST:$ETCD_PORT"
15-
export ETCD_PATH=${ETCD_PATH:-/deis/router/$HOST}
15+
export ETCD_PATH=${ETCD_PATH:-/deis/router}
16+
export HOST_ETCD_PATH=${HOST_ETCD_PATH:-/deis/router/$HOST}
1617
export ETCD_TTL=${ETCD_TTL:-10}
1718

1819
# wait for etcd to be available
@@ -36,7 +37,6 @@ etcd_safe_mkdir /deis/controller
3637
etcd_safe_mkdir /deis/services
3738
etcd_safe_mkdir /deis/domains
3839
etcd_safe_mkdir /deis/builder
39-
etcd_set_default port ${PORT:-80}
4040
etcd_set_default gzip on
4141
etcd_set_default gzipHttpVersion 1.0
4242
etcd_set_default gzipCompLevel 2
@@ -84,8 +84,8 @@ if [[ ! -z $EXTERNAL_PORT ]]; then
8484

8585
# while the port is listening, publish to etcd
8686
while [[ ! -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PORT\" && \$1 ~ \"$PROTO.?\"") ]] ; do
87-
etcdctl --no-sync -C $ETCD set $ETCD_PATH/host $HOST --ttl $ETCD_TTL >/dev/null
88-
etcdctl --no-sync -C $ETCD set $ETCD_PATH/port $EXTERNAL_PORT --ttl $ETCD_TTL >/dev/null
87+
etcdctl --no-sync -C $ETCD set $HOST_ETCD_PATH/host $HOST --ttl $ETCD_TTL >/dev/null
88+
etcdctl --no-sync -C $ETCD set $HOST_ETCD_PATH/port $EXTERNAL_PORT --ttl $ETCD_TTL >/dev/null
8989
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
9090
done
9191

router/tests/router_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func TestRouter(t *testing.T) {
5656
// FIXME: Wait until etcd keys are published
5757
time.Sleep(5000 * time.Millisecond)
5858
dockercli.DeisServiceTest(t, name, port, "http")
59+
etcdutils.VerifyEtcdValue(t, "/deis/router/gzip", "on", etcdPort)
5960
routerKeyPrefix := "/deis/router/"+host
6061
etcdutils.VerifyEtcdValue(t, routerKeyPrefix+"/host", host, etcdPort)
6162
etcdutils.VerifyEtcdValue(t, routerKeyPrefix+"/port", port, etcdPort)

0 commit comments

Comments
 (0)