mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-22 00:06:04 +08:00
Merge pull request #2044 from gravitl/GRA-1194/extclient_egress
Gra 1194: add egress ranges of the peer GW to ingress info
This commit is contained in:
commit
3c2ec68fe6
|
@ -405,6 +405,10 @@ func GetPeerUpdateForHost(host *models.Host) (models.HostPeerUpdate, error) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if node.IsIngressGateway && peer.IsEgressGateway {
|
||||
hostPeerUpdate.IngressInfo.EgressRanges = append(hostPeerUpdate.IngressInfo.EgressRanges,
|
||||
peer.EgressGatewayRanges...)
|
||||
}
|
||||
nodePeerMap[peerHost.PublicKey.String()] = models.PeerRouteInfo{
|
||||
PeerAddr: net.IPNet{
|
||||
IP: net.ParseIP(peer.PrimaryAddress()),
|
||||
|
|
|
@ -31,7 +31,8 @@ type HostPeerUpdate struct {
|
|||
|
||||
// IngressInfo - struct for ingress info
|
||||
type IngressInfo struct {
|
||||
ExtPeers map[string]ExtClientInfo `json:"ext_peers" yaml:"ext_peers"`
|
||||
ExtPeers map[string]ExtClientInfo `json:"ext_peers" yaml:"ext_peers"`
|
||||
EgressRanges []string `json:"egress_ranges" yaml:"egress_ranges"`
|
||||
}
|
||||
|
||||
// EgressInfo - struct for egress info
|
||||
|
|
Loading…
Reference in a new issue