diff --git a/consul/leader.go b/consul/leader.go index c721d1915d..92bea6fa7d 100644 --- a/consul/leader.go +++ b/consul/leader.go @@ -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 diff --git a/consul/server.go b/consul/server.go index a3b5baea20..291461b709 100644 --- a/consul/server.go +++ b/consul/server.go @@ -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):