@@ -15,7 +15,7 @@ export ETCD_PATH=${ETCD_PATH:-/deis/controller}
1515export ETCD_TTL=${ETCD_TTL:- 10}
1616
1717# wait for etcd to be available
18- until etcdctl -C $ETCD ls > /dev/null; do
18+ until etcdctl --no-sync - C $ETCD ls > /dev/null; do
1919 echo " waiting for etcd at $ETCD ..."
2020 sleep $(( $ETCD_TTL / 2 )) # sleep for half the TTL
2121done
2424sleep $(( $ETCD_TTL + 1 ))
2525
2626# seed initial service configuration if necessary
27- if ! etcdctl -C $ETCD ls $ETCD_PATH > /dev/null 2>&1 ; then
28- etcdctl -C $ETCD set $ETCD_PATH /protocol ${DEIS_PROTOCOL:- http} > /dev/null
29- etcdctl -C $ETCD set $ETCD_PATH /secretKey ${DEIS_SECRET_KEY:- `openssl rand -base64 64 | tr -d ' \n' `} > /dev/null
30- etcdctl -C $ETCD set $ETCD_PATH /builderKey ${DEIS_BUILDER_KEY:- `openssl rand -base64 64 | tr -d ' \n' `} > /dev/null
27+ if ! etcdctl --no-sync - C $ETCD ls $ETCD_PATH > /dev/null 2>&1 ; then
28+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /protocol ${DEIS_PROTOCOL:- http} > /dev/null
29+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /secretKey ${DEIS_SECRET_KEY:- `openssl rand -base64 64 | tr -d ' \n' `} > /dev/null
30+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /builderKey ${DEIS_BUILDER_KEY:- `openssl rand -base64 64 | tr -d ' \n' `} > /dev/null
3131fi
3232
3333# wait for confd to run once and install initial templates
@@ -82,8 +82,8 @@ if [[ ! -z $PUBLISH ]]; then
8282
8383 # while the port is listening, publish to etcd
8484 while [[ ! -z $( netstat -lnt | awk " \$ 6 == \" LISTEN\" && \$ 4 ~ \" .$PUBLISH \" && \$ 1 ~ \" $PROTO .?\" " ) ]] ; do
85- etcdctl -C $ETCD set $ETCD_PATH /host $HOST --ttl $ETCD_TTL > /dev/null
86- etcdctl -C $ETCD set $ETCD_PATH /port $PORT --ttl $ETCD_TTL > /dev/null
85+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /host $HOST --ttl $ETCD_TTL > /dev/null
86+ etcdctl --no-sync - C $ETCD set $ETCD_PATH /port $PORT --ttl $ETCD_TTL > /dev/null
8787 sleep $(( $ETCD_TTL / 2 )) # sleep for half the TTL
8888 done
8989
0 commit comments