mirror of https://github.com/status-im/consul.git
Store WanAddress during Service/Check sync
This commit is contained in:
parent
9300a13643
commit
ed8a71efd7
|
@ -526,6 +526,7 @@ func (l *localState) syncService(id string) error {
|
|||
Datacenter: l.config.Datacenter,
|
||||
Node: l.config.NodeName,
|
||||
Address: l.config.AdvertiseAddr,
|
||||
WanAddress: l.config.ConsulConfig.SerfWANConfig.MemberlistConfig.AdvertiseAddr,
|
||||
Service: l.services[id],
|
||||
WriteRequest: structs.WriteRequest{Token: l.serviceToken(id)},
|
||||
}
|
||||
|
@ -583,6 +584,7 @@ func (l *localState) syncCheck(id string) error {
|
|||
Datacenter: l.config.Datacenter,
|
||||
Node: l.config.NodeName,
|
||||
Address: l.config.AdvertiseAddr,
|
||||
WanAddress: l.config.ConsulConfig.SerfWANConfig.MemberlistConfig.AdvertiseAddr,
|
||||
Service: service,
|
||||
Check: l.checks[id],
|
||||
WriteRequest: structs.WriteRequest{Token: l.checkToken(id)},
|
||||
|
|
|
@ -380,6 +380,11 @@ func (s *Server) handleAliveMember(member serf.Member) error {
|
|||
return err
|
||||
}
|
||||
if node != nil && node.Address == member.Addr.String() {
|
||||
// Check if the WAN address was updated
|
||||
if node.WanAddress != member.Tags["WanAddr"] {
|
||||
goto AFTER_CHECK
|
||||
}
|
||||
|
||||
// Check if the associated service is available
|
||||
if service != nil {
|
||||
match := false
|
||||
|
|
Loading…
Reference in New Issue