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.
pull/3451/head
James Phillips 2017-09-06 17:05:40 -07:00
parent c283dc4202
commit 5c03cb571d
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
1 changed files with 8 additions and 8 deletions

View File

@ -54,23 +54,23 @@ func (md *lanMergeDelegate) NotifyMerge(members []*serf.Member) error {
} }
} }
ok, dc := isConsulNode(*m) if ok, dc := isConsulNode(*m); ok {
if ok {
if dc != md.dc { if dc != md.dc {
return fmt.Errorf("Member '%s' part of wrong datacenter '%s'", return fmt.Errorf("Member '%s' part of wrong datacenter '%s'",
m.Name, dc) m.Name, dc)
} }
continue
} }
ok, parts := metadata.IsConsulServer(*m) if ok, parts := metadata.IsConsulServer(*m); ok {
if ok && parts.Datacenter != md.dc { if parts.Datacenter != md.dc {
return fmt.Errorf("Member '%s' part of wrong datacenter '%s'", return fmt.Errorf("Member '%s' part of wrong datacenter '%s'",
m.Name, parts.Datacenter) m.Name, parts.Datacenter)
}
} }
if segment := m.Tags["segment"]; segment != md.segment { 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 return nil