mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-27 19:00:25 +08:00
NET-528: add host static info to peer update (#2550)
* set isstatic field on peer update * remove static check for peer port
This commit is contained in:
@@ -181,6 +181,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
|
||||
hostPeerUpdate.HostNetworkInfo[peerHost.PublicKey.String()] = models.HostNetworkInfo{
|
||||
Interfaces: peerHost.Interfaces,
|
||||
ListenPort: peerPort,
|
||||
IsStatic: peerHost.IsStatic,
|
||||
}
|
||||
nodePeer = peerConfig
|
||||
} else {
|
||||
@@ -191,6 +192,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
|
||||
hostPeerUpdate.HostNetworkInfo[peerHost.PublicKey.String()] = models.HostNetworkInfo{
|
||||
Interfaces: peerHost.Interfaces,
|
||||
ListenPort: peerPort,
|
||||
IsStatic: peerHost.IsStatic,
|
||||
}
|
||||
nodePeer = hostPeerUpdate.Peers[peerIndexMap[peerHost.PublicKey.String()]]
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ type HostInfoMap map[string]HostNetworkInfo
|
||||
type HostNetworkInfo struct {
|
||||
Interfaces []Iface `json:"interfaces" yaml:"interfaces"`
|
||||
ListenPort int `json:"listen_port" yaml:"listen_port"`
|
||||
IsStatic bool `json:"is_static"`
|
||||
}
|
||||
|
||||
// PeerMap - peer map for ids and addresses in metrics
|
||||
|
||||
Reference in New Issue
Block a user