feat(etcd): Default server listen and client listen to advertised IPs
Map the advertised IP to the listening IP by default. This will make things nicer for the user.
This commit is contained in:
7
util.go
7
util.go
@ -114,11 +114,16 @@ func sanitizeListenHost(listen string, advertised string) string {
|
||||
fatal(err)
|
||||
}
|
||||
|
||||
_, aport, err := net.SplitHostPort(aurl.Host)
|
||||
ahost, aport, err := net.SplitHostPort(aurl.Host)
|
||||
if err != nil {
|
||||
fatal(err)
|
||||
}
|
||||
|
||||
// If the listen host isn't set use the advertised host
|
||||
if listen == "" {
|
||||
listen = ahost
|
||||
}
|
||||
|
||||
return net.JoinHostPort(listen, aport)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user