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 e166d2a4c7
commit d123b4dece
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