mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-07 13:44:17 +08:00
update version/firewall in use if changed on checkin (#2335)
This commit is contained in:
parent
47edf65b1f
commit
6f11eb2bb0
1 changed files with 9 additions and 0 deletions
|
@ -428,6 +428,15 @@ func handleHostCheckin(h, currentHost *models.Host) bool {
|
|||
for i := range h.Interfaces {
|
||||
h.Interfaces[i].AddressString = h.Interfaces[i].Address.String()
|
||||
}
|
||||
/// version or firewall in use change does not require a peerUpdate
|
||||
if h.Version != currentHost.Version || h.FirewallInUse != currentHost.FirewallInUse {
|
||||
currentHost.FirewallInUse = h.FirewallInUse
|
||||
currentHost.Version = h.Version
|
||||
if err := logic.UpsertHost(currentHost); err != nil {
|
||||
logger.Log(0, "failed to update host after check-in", h.Name, h.ID.String(), err.Error())
|
||||
return false
|
||||
}
|
||||
}
|
||||
ifaceDelta := len(h.Interfaces) != len(currentHost.Interfaces) ||
|
||||
!h.EndpointIP.Equal(currentHost.EndpointIP) ||
|
||||
(len(h.NatType) > 0 && h.NatType != currentHost.NatType) ||
|
||||
|
|
Loading…
Add table
Reference in a new issue