move peer validation into getPeerconnectionResources

This commit is contained in:
Pascal Fischer 2023-12-04 14:53:38 +01:00
parent b9fc008542
commit 89249b414f
2 changed files with 3 additions and 1 deletions

View File

@ -368,7 +368,6 @@ func (a *Account) GetPeerNetworkMap(peerID, dnsDomain string) *NetworkMap {
}
}
aclPeers, firewallRules := a.getPeerConnectionResources(peerID)
aclPeers = additions.ValidatePeers(aclPeers)
// exclude expired peers
var peersToConnect []*nbpeer.Peer
var expiredPeers []*nbpeer.Peer

View File

@ -5,6 +5,7 @@ import (
"strconv"
"strings"
"github.com/netbirdio/management-integrations/additions"
log "github.com/sirupsen/logrus"
"github.com/netbirdio/netbird/management/proto"
@ -220,6 +221,8 @@ func (a *Account) getPeerConnectionResources(peerID string) ([]*nbpeer.Peer, []*
sourcePeers, peerInSources := getAllPeersFromGroups(a, rule.Sources, peerID)
destinationPeers, peerInDestinations := getAllPeersFromGroups(a, rule.Destinations, peerID)
sourcePeers = additions.ValidatePeers(sourcePeers)
destinationPeers = additions.ValidatePeers(destinationPeers)
if rule.Bidirectional {
if peerInSources {