summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongbin Lu <hongbin.lu@huawei.com>2017-04-29 13:52:43 -0400
committerHongbin Lu <hongbin.lu@huawei.com>2017-04-29 13:52:43 -0400
commitd9cbc6c32583b538b25e12319d0f9d16046d2fdc (patch)
treeff7d68ba41a6c140070e1006d4bb35c1d4cd726e
parenta6365b0570c6f5e3c8df5da90858d24c4e8814c2 (diff)
Removing the confusing SWARM_MODE variable
The SWARM_MODE variable is for determining whether to set the cluster_store options of docker daemon. Therefore, change it to DOCKER_CLUSTER_STORE to make it clear. Change-Id: I79f00c7cc158d825627ce6a9d28b053b0cf3c076
Notes
Notes (review): Code-Review+2: Liping Mao <limao@cisco.com> Workflow+1: Liping Mao <limao@cisco.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sun, 30 Apr 2017 02:01:23 +0000 Reviewed-on: https://review.openstack.org/461227 Project: openstack/devstack-plugin-container Branch: refs/heads/master
-rw-r--r--devstack/lib/docker7
1 files changed, 3 insertions, 4 deletions
diff --git a/devstack/lib/docker b/devstack/lib/docker
index 77f8edb..60448e4 100644
--- a/devstack/lib/docker
+++ b/devstack/lib/docker
@@ -4,7 +4,6 @@
4# 4#
5# - functions 5# - functions
6# - ``STACK_USER`` must be defined 6# - ``STACK_USER`` must be defined
7# - ``ETCD_PORT`` must be defined if on swarm mode
8 7
9# stack.sh 8# stack.sh
10# --------- 9# ---------
@@ -24,7 +23,7 @@ set +o xtrace
24 23
25DOCKER_ENGINE_SOCKET_FILE=${DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock} 24DOCKER_ENGINE_SOCKET_FILE=${DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock}
26DOCKER_ENGINE_PORT=${DOCKER_ENGINE_PORT:-2375} 25DOCKER_ENGINE_PORT=${DOCKER_ENGINE_PORT:-2375}
27SWARM_MODE=$(trueorfalse False SWARM_MODE) 26DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-}
28 27
29 28
30# Functions 29# Functions
@@ -75,8 +74,8 @@ function configure_docker {
75 sudo systemctl stop docker.service || true 74 sudo systemctl stop docker.service || true
76 75
77 local cluster_store_opts="" 76 local cluster_store_opts=""
78 if [[ "$SWARM_MODE" = "True" ]]; then 77 if [[ -n "$DOCKER_CLUSTER_STORE" ]]; then
79 cluster_store_opts+="\"cluster-store\": \"etcd://localhost:$ETCD_PORT\"," 78 cluster_store_opts+="\"cluster-store\": \"$DOCKER_CLUSTER_STORE\","
80 fi 79 fi
81 local docker_config_file=/etc/docker/daemon.json 80 local docker_config_file=/etc/docker/daemon.json
82 sudo mkdir -p $(dirname ${docker_config_file}) 81 sudo mkdir -p $(dirname ${docker_config_file})