mirror of https://github.com/docker/docs.git
parent
a17f182026
commit
f1b7b7be59
|
@ -99,7 +99,7 @@ function teardown() {
|
|||
swarm_join "$DISCOVERY"
|
||||
|
||||
# Start a manager. It should keep retrying
|
||||
swarm_manage "$DISCOVERY"
|
||||
swarm_manage_no_wait "$DISCOVERY"
|
||||
|
||||
# Now start the store
|
||||
start_store
|
||||
|
|
|
@ -106,7 +106,7 @@ function teardown() {
|
|||
swarm_join "$DISCOVERY"
|
||||
|
||||
# Start a manager. It should keep retrying
|
||||
swarm_manage "$DISCOVERY"
|
||||
swarm_manage_no_wait "$DISCOVERY"
|
||||
|
||||
# Now start the store
|
||||
start_store
|
||||
|
|
|
@ -82,7 +82,7 @@ function setup_discovery_file() {
|
|||
start_docker 2
|
||||
|
||||
# Start a manager. It should keep retrying
|
||||
swarm_manage "$DISCOVERY"
|
||||
swarm_manage_no_wait "$DISCOVERY"
|
||||
|
||||
# Now create the discovery file.
|
||||
setup_discovery_file
|
||||
|
|
|
@ -99,7 +99,7 @@ function teardown() {
|
|||
swarm_join "$DISCOVERY"
|
||||
|
||||
# Start a manager. It should keep retrying
|
||||
swarm_manage "$DISCOVERY"
|
||||
swarm_manage_no_wait "$DISCOVERY"
|
||||
|
||||
# Now start the store
|
||||
start_store
|
||||
|
|
|
@ -95,8 +95,17 @@ function discovery_check_swarm_info() {
|
|||
retry 10 1 eval "docker -H $host info | grep -q -e \"Nodes: $total\" -e \"Offers: $total\""
|
||||
}
|
||||
|
||||
# Start the swarm manager in background.
|
||||
function swarm_manage() {
|
||||
local i=${#SWARM_MANAGE_PID[@]}
|
||||
|
||||
swarm_manage_no_wait "$@"
|
||||
|
||||
# Wait for nodes to be discovered
|
||||
discovery_check_swarm_info "${#HOSTS[@]}" "${SWARM_HOSTS[$i]}"
|
||||
}
|
||||
|
||||
# Start the swarm manager in background.
|
||||
function swarm_manage_no_wait() {
|
||||
local discovery
|
||||
if [ $# -eq 0 ]; then
|
||||
discovery=`join , ${HOSTS[@]}`
|
||||
|
@ -114,9 +123,6 @@ function swarm_manage() {
|
|||
|
||||
# Wait for the Manager to be reachable
|
||||
wait_until_reachable "$host"
|
||||
|
||||
# Wait for nodes to be discovered
|
||||
discovery_check_swarm_info "${#HOSTS[@]}" "$host"
|
||||
}
|
||||
|
||||
# swarm join every engine created with `start_docker`.
|
||||
|
|
Loading…
Reference in New Issue