add advertise grpc address option

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2019-10-07 13:52:47 -04:00
parent 4bc08c92c2
commit 190ec3130d
12 changed files with 415 additions and 204 deletions

View file

@ -28,15 +28,7 @@ import (
)
// Join attempts to connect to the peer and returns the master info
func (c *Client) Join(key string) (*v1.Master, error) {
func (c *Client) Join(req *v1.JoinRequest) (*v1.JoinResponse, error) {
ctx := context.Background()
resp, err := c.heimdallClient.Join(ctx, &v1.JoinRequest{
ID: c.id,
ClusterKey: key,
})
if err != nil {
return nil, err
}
return resp.Master, nil
return c.heimdallClient.Join(ctx, req)
}