Skip to content

Commit

Permalink
Failure to resolve advertise address isn't fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Nov 8, 2016
1 parent c312838 commit 4c2e6cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,12 @@ func (c *Command) readConfig() *Config {
}
ip, err := net.ResolveIPAddr("ip", host)
if err != nil {
c.Ui.Error(fmt.Sprintf("Unable to resolve hostname to set advertise address: %v", err))
return false
// Just because this node can't resolve its advertise
// address doesn't mean it's a bad address; use it
defaultAdvertise = host
newaddr := fmt.Sprintf("%s:%d", defaultAdvertise, port)
*addr = newaddr
return true
}
if ip.IP.IsLoopback() && !dev {
c.Ui.Error("Unable to select default advertise address as hostname resolves to localhost")
Expand Down

0 comments on commit 4c2e6cc

Please sign in to comment.