From 5c03cb571da1d9a0fc37f4acb7dbb19b10b82936 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 6 Sep 2017 17:05:40 -0700 Subject: [PATCH] Takes the skip out of the client check. Without this the merge delegate won't check the segment for non-servers a little below here. --- agent/consul/merge.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/agent/consul/merge.go b/agent/consul/merge.go index b74634c8d9..508ba3dc1d 100644 --- a/agent/consul/merge.go +++ b/agent/consul/merge.go @@ -54,23 +54,23 @@ func (md *lanMergeDelegate) NotifyMerge(members []*serf.Member) error { } } - ok, dc := isConsulNode(*m) - if ok { + if ok, dc := isConsulNode(*m); ok { if dc != md.dc { return fmt.Errorf("Member '%s' part of wrong datacenter '%s'", m.Name, dc) } - continue } - ok, parts := metadata.IsConsulServer(*m) - if ok && parts.Datacenter != md.dc { - return fmt.Errorf("Member '%s' part of wrong datacenter '%s'", - m.Name, parts.Datacenter) + if ok, parts := metadata.IsConsulServer(*m); ok { + if parts.Datacenter != md.dc { + return fmt.Errorf("Member '%s' part of wrong datacenter '%s'", + m.Name, parts.Datacenter) + } } if segment := m.Tags["segment"]; segment != md.segment { - return fmt.Errorf("Member '%s' part of wrong segment '%s' (expected '%s')", m.Name, segment, md.segment) + return fmt.Errorf("Member '%s' part of wrong segment '%s' (expected '%s')", + m.Name, segment, md.segment) } } return nil