From 3dab50318ef975b0df8e780b9e4d83ae64d8b10d Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 7 Nov 2016 17:25:34 -0800 Subject: [PATCH] Failure to resolve advertise address isn't fatal --- command/agent/command.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index dff1adfc2..0321b4b01 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -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")