diff --git a/cluster/bootstrap.go b/cluster/bootstrap.go index 1ebc3597..7c10a864 100644 --- a/cluster/bootstrap.go +++ b/cluster/bootstrap.go @@ -175,7 +175,7 @@ func (b *Bootstrapper) notify(targets []string, id, raftAddr string) error { Id: id, } for _, t := range targets { - if err := b.client.Notify(nr, t, requestTimeout); err != nil { + if err := b.client.Notify(nr, t, b.creds, requestTimeout); err != nil { return fmt.Errorf("failed to notify node at %s: %s", t, err) } } diff --git a/cluster/client.go b/cluster/client.go index e60ac6f7..8de9b48d 100644 --- a/cluster/client.go +++ b/cluster/client.go @@ -299,7 +299,7 @@ func (c *Client) RemoveNode(rn *command.RemoveNodeRequest, nodeAddr string, cred } // Notify notifies a remote node that this node is ready to bootstrap. -func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, timeout time.Duration) error { +func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, creds *Credentials, timeout time.Duration) error { conn, err := c.dial(nodeAddr, c.timeout) if err != nil { return err @@ -312,6 +312,7 @@ func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, timeout time Request: &Command_NotifyRequest{ NotifyRequest: nr, }, + Credentials: creds, } if err := writeCommand(conn, command, timeout); err != nil { handleConnError(conn) diff --git a/cluster/service_test.go b/cluster/service_test.go index 5a5ac343..e665ef24 100644 --- a/cluster/service_test.go +++ b/cluster/service_test.go @@ -294,7 +294,7 @@ func Test_NewServiceNotify(t *testing.T) { // Test by connecting to itself. c := NewClient(ml, 30*time.Second) - err := c.Notify(nr, s.Addr(), 5*time.Second) + err := c.Notify(nr, s.Addr(), nil, 5*time.Second) if err != nil { t.Fatalf("failed to notify node: %s", err) } @@ -304,7 +304,7 @@ func Test_NewServiceNotify(t *testing.T) { // Test when auth is enabled credStr.HasPermOK = false - err = c.Notify(nr, s.Addr(), 5*time.Second) + err = c.Notify(nr, s.Addr(), nil, 5*time.Second) if err == nil { t.Fatal("should have failed to notify node due to lack of auth") } diff --git a/system_test/helpers.go b/system_test/helpers.go index bbb9c46e..9e929cf7 100644 --- a/system_test/helpers.go +++ b/system_test/helpers.go @@ -225,7 +225,7 @@ func (n *Node) Notify(id, raftAddr string) error { Id: n.Store.ID(), Address: n.RaftAddr, } - return n.Client.Notify(nr, raftAddr, 5*time.Second) + return n.Client.Notify(nr, raftAddr, nil, 5*time.Second) } // NodesStatus is the Go type /nodes endpoint response is marshaled into.