open-nomad/nomad/merge.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
481 B
Go
Raw Normal View History

2015-06-03 10:58:00 +00:00
package nomad
import (
"fmt"
"github.com/hashicorp/serf/serf"
)
2015-06-03 10:58:00 +00:00
// serfMergeDelegate is used to handle a cluster merge on the gossip
// ring. We check that the peers are nomad servers and abort the merge
// otherwise.
type serfMergeDelegate struct {
}
func (md *serfMergeDelegate) NotifyMerge(members []*serf.Member) error {
for _, m := range members {
ok, _ := isNomadServer(*m)
if !ok {
return fmt.Errorf("member '%s' is not a server", m.Name)
}
}
2015-06-03 10:58:00 +00:00
return nil
}