Rectify value of `AdvertiseAddrWan` when set elsewhere

`AdvertiseAddrs` has been introduced as a configuration option, which
duplicates a few other options, namely `AdvertiseAddrWan`. We need to
use this value elsewhere, so rather than doing a precedence check every
time we need to access it, rectify the value of `AdvertiseAddrWan` to
match
This commit is contained in:
Evan Gilman 2015-12-09 21:58:23 -08:00 committed by James Phillips
parent 069a28b3c0
commit 8fa2a60208
1 changed files with 1 additions and 0 deletions

View File

@ -287,6 +287,7 @@ func (a *Agent) consulConfig() *consul.Config {
if a.config.AdvertiseAddrs.SerfWan != nil {
base.SerfWANConfig.MemberlistConfig.AdvertiseAddr = a.config.AdvertiseAddrs.SerfWan.IP.String()
base.SerfWANConfig.MemberlistConfig.AdvertisePort = a.config.AdvertiseAddrs.SerfWan.Port
a.config.AdvertiseAddrWan = a.config.AdvertiseAddrs.SerfWan.IP.String()
}
if a.config.AdvertiseAddrs.RPC != nil {
base.RPCAdvertise = a.config.AdvertiseAddrs.RPC