From 8e9503c42681b776e9b8edc551bc6103c0ee09f6 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Sat, 9 Apr 2016 21:16:52 -0700 Subject: [PATCH 1/2] Updated the consul in Vagrant env --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 967a8cbcc..91727306f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -42,7 +42,7 @@ source /etc/profile.d/gopath.sh echo Fetching Consul... cd /tmp/ -wget https://releases.hashicorp.com/consul/0.6.0/consul_0.6.0_linux_amd64.zip -O consul.zip +wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip -O consul.zip echo Installing Consul... unzip consul.zip sudo chmod +x consul From ba9ff3b5360bc0fde8a61ece4f3f8ad36359ffd3 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Mon, 11 Apr 2016 20:08:35 -0400 Subject: [PATCH 2/2] Reading consul attr from copy of node attributes --- client/client.go | 6 +++++- vendor/github.com/logrus | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) create mode 160000 vendor/github.com/logrus diff --git a/client/client.go b/client/client.go index dd684c5e0..50a070e67 100644 --- a/client/client.go +++ b/client/client.go @@ -1192,7 +1192,11 @@ func (c *Client) syncConsul() { select { case <-sync.C: // Give up pruning services if we can't fingerprint Consul - if _, ok := c.config.Node.Attributes["consul.server"]; !ok { + + c.configLock.RLock() + _, ok := c.configCopy.Node.Attributes["consul.server"] + c.configLock.RUnlock() + if !ok { continue } services := make(map[string]struct{}) diff --git a/vendor/github.com/logrus b/vendor/github.com/logrus new file mode 160000 index 000000000..4b6ea7319 --- /dev/null +++ b/vendor/github.com/logrus @@ -0,0 +1 @@ +Subproject commit 4b6ea7319e214d98c938f12692336f7ca9348d6b