Merge pull request #3451 from hashicorp/merge-fix

Takes the skip out of the client check.
This commit is contained in:
James Phillips 2017-09-06 17:10:49 -07:00 committed by GitHub
commit a6b2d97e05
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 {
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 {
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