Skip to content

Commit

Permalink
Add domain name lookup for gossip adverstise address
Browse files Browse the repository at this point in the history
  • Loading branch information
kevburnsjr committed Jan 6, 2025
1 parent 429d908 commit 97e77bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ func (a *Agent) Start(ctx context.Context) (err error) {
}
}()
// Resolve member gossip addresses
a.hostConfig.Gossip.AdvertiseAddress, err = a.gossipIP(a.hostConfig.Gossip.AdvertiseAddress)
if err != nil {
a.log.Errorf(`Failed to resolve gossip advertise address: %v`, err)
return
}
a.hostConfig.Gossip.Seed, err = a.resolvePeerGossipSeed()
if err != nil {
a.log.Errorf(`Failed to resolve gossip seeds: %v`, err)
Expand Down Expand Up @@ -502,6 +507,7 @@ func (a *Agent) resolvePeerGossipSeed() (gossip []string, err error) {
a.log.Warningf("No probe response for %s %+v %v", peerApiAddr, res, err.Error())
}
}
a.log.Infof("Peers: %#v", a.peers)
a.log.Infof("Found %d of %d peers %+v", len(gossip), len(a.peers), gossip)
if len(gossip) < len(a.peers) {
select {
Expand Down

0 comments on commit 97e77bb

Please sign in to comment.