File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,9 +274,16 @@ write_files:
274274 /usr/bin/docker exec deis-store-admin ceph mon remove `hostname -f` # fixme
275275 /usr/bin/docker stop deis-store-metadata || true
276276 fi
277- NODE=$(curl -L http://127.0.0.1:7001/v2/admin/machines/`cat /etc/machine-id`)
278- # remove from etcd cluster
279- if [ $NODE != 'null' ]; then
280- /usr/bin/curl -L -XDELETE http://127.0.0.1:7001/v2/admin/machines/`cat /etc/machine-id`
277+
278+ # TODO: remove the next check once etcdctl is using etcd2
279+ ETCDCTL=/usr/bin/etcdctl
280+ if ! $ETCDCTL --version | grep -q "etcdctl version 2.0."; then
281+ ETCD_VERSION=2.0.13
282+ curl -sSL https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz | \
283+ tar zxv -C /opt/bin etcd-v${ETCD_VERSION}-linux-amd64/etcdctl --strip=1
284+ ETCDCTL="/opt/bin/etcdctl"
281285 fi
286+ # removing the node from etcd
287+ NODE=$($ETCDCTL member list | grep `cat /etc/machine-id` | cut -d ':' -f 1)
288+ $ETCDCTL member remove $NODE
282289manage_etc_hosts: localhost
You can’t perform that action at this time.
0 commit comments