mirror of
https://github.com/status-im/consul.git
synced 2025-01-22 03:29:43 +00:00
consul: Fixing for upstream API changes
This commit is contained in:
parent
97541402be
commit
888ce89b91
@ -367,7 +367,7 @@ func (s *Server) joinConsulServer(m serf.Member, parts *serverParts) error {
|
||||
// Attempt to add as a peer
|
||||
var addr net.Addr = &net.TCPAddr{IP: m.Addr, Port: parts.Port}
|
||||
future := s.raft.AddPeer(addr)
|
||||
if err := future.Error(); err != nil && err != raft.KnownPeer {
|
||||
if err := future.Error(); err != nil && err != raft.ErrKnownPeer {
|
||||
s.logger.Printf("[ERR] consul: failed to add raft peer: %v", err)
|
||||
return err
|
||||
}
|
||||
@ -384,7 +384,7 @@ func (s *Server) removeConsulServer(m serf.Member, port int) error {
|
||||
// Attempt to remove as peer
|
||||
peer := &net.TCPAddr{IP: m.Addr, Port: port}
|
||||
future := s.raft.RemovePeer(peer)
|
||||
if err := future.Error(); err != nil && err != raft.UnknownPeer {
|
||||
if err := future.Error(); err != nil && err != raft.ErrUnknownPeer {
|
||||
s.logger.Printf("[ERR] consul: failed to remove raft peer '%v': %v",
|
||||
peer, err)
|
||||
return err
|
||||
|
@ -458,7 +458,7 @@ func (s *Server) Leave() error {
|
||||
select {
|
||||
case err := <-ch:
|
||||
// Ignore if we have already been deregistered by the leader
|
||||
if err != nil && err.Error() != raft.UnknownPeer.Error() {
|
||||
if err != nil && err.Error() != raft.ErrUnknownPeer.Error() {
|
||||
s.logger.Printf("[ERR] consul: failed to leave Raft cluster: %v", err)
|
||||
}
|
||||
case <-time.After(3 * time.Second):
|
||||
|
Loading…
x
Reference in New Issue
Block a user