mirror of https://github.com/docker/docs.git
Fix etcd SyncCluster and Integration tests
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
a43a1a869d
commit
6eb5cd3b5c
|
|
@ -51,6 +51,7 @@ func InitializeEtcd(addrs []string, options *Config) (Store, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.client.SyncCluster()
|
||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
load discovery_helpers
|
load discovery_helpers
|
||||||
|
|
||||||
# Address on which the store will listen (random port between 8000 and 9000).
|
# Port and Address on which the store will listen (random port between 8000 and 9000).
|
||||||
STORE_HOST=127.0.0.1:$(( ( RANDOM % 1000 ) + 9000 ))
|
PORT=$((RANDOM % 1000 + 9000))
|
||||||
|
STORE_HOST=127.0.0.1:$PORT
|
||||||
|
|
||||||
# Discovery parameter for Swarm
|
# Discovery parameter for Swarm
|
||||||
DISCOVERY="etcd://${STORE_HOST}/test"
|
DISCOVERY="etcd://${STORE_HOST}/test"
|
||||||
|
|
@ -12,11 +13,14 @@ DISCOVERY="etcd://${STORE_HOST}/test"
|
||||||
CONTAINER_NAME=swarm_etcd
|
CONTAINER_NAME=swarm_etcd
|
||||||
|
|
||||||
function start_store() {
|
function start_store() {
|
||||||
docker_host run -p $STORE_HOST:4001 \
|
docker_host run -d \
|
||||||
--name=$CONTAINER_NAME -d \
|
--net=host \
|
||||||
|
--name=$CONTAINER_NAME \
|
||||||
quay.io/coreos/etcd:v2.0.11 \
|
quay.io/coreos/etcd:v2.0.11 \
|
||||||
--listen-client-urls=http://0.0.0.0:2379,http://0.0.0.0:4001 \
|
--listen-client-urls="http://0.0.0.0:${PORT}" \
|
||||||
--advertise-client-urls=http://$STORE_HOST
|
--advertise-client-urls="http://${STORE_HOST}"
|
||||||
|
|
||||||
|
sleep 3
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop_store() {
|
function stop_store() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue