Default gossip seed should be empty instead of local bind address

This commit is contained in:
Travis Turner 2018-03-23 15:11:45 -05:00
parent 62cd22f017
commit 8686a8645c
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9

View file

@ -63,6 +63,9 @@ func (g *GossipMemberSet) Start(h pilosa.BroadcastHandler) error {
// Seeds returns the gossipSeeds determined by the config.
func (g *GossipMemberSet) Seeds() []string {
if len(g.config.gossipSeeds) == 0 {
return []string{fmt.Sprintf("%s:%d", g.config.memberlistConfig.BindAddr, g.config.memberlistConfig.BindPort)}
}
return g.config.gossipSeeds
}
@ -202,11 +205,6 @@ func NewGossipMemberSetWithTransport(name string, cfg *pilosa.Config, transport
g.statusHandler = server
// If no gossipSeeds is provided, use local host:port.
if len(cfg.Gossip.Seeds) == 0 {
g.config.gossipSeeds = []string{fmt.Sprintf("%s:%d", host, port)}
}
return g, nil
}