Skip to content

Commit

Permalink
Fix sonar
Browse files Browse the repository at this point in the history
Signed-off-by: bcmmbaga <[email protected]>
  • Loading branch information
bcmmbaga committed Dec 20, 2024
1 parent a031b4a commit bb882c8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions management/server/types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -1309,11 +1309,11 @@ func (a *Account) GetNetworkResourcesRoutesToSync(ctx context.Context, peerID st
var allSourcePeers []string

for _, resource := range a.NetworkResources {

if networkRoutingPeers, exists := routers[resource.NetworkID]; exists {
if _, ok := networkRoutingPeers[peerID]; ok {
networkRoutingPeers, exists := routers[resource.NetworkID]
if exists {
if router, ok := networkRoutingPeers[peerID]; ok {
isRoutingPeer = true
routes = append(routes, a.getNetworkResourcesRoutes(resource, peerID, networkRoutingPeers[peerID], resourcePolicies)...)
routes = append(routes, a.getNetworkResourcesRoutes(resource, peerID, router, resourcePolicies)...)
}
}

Expand All @@ -1326,10 +1326,8 @@ func (a *Account) GetNetworkResourcesRoutesToSync(ctx context.Context, peerID st
}

// routing peer should be able to connect with all source peers
if networkRoutingPeers, exists := routers[resource.NetworkID]; exists {
if _, ok := networkRoutingPeers[peerID]; ok {
allSourcePeers = append(allSourcePeers, group.Peers...)
}
if _, ok := networkRoutingPeers[peerID]; ok {
allSourcePeers = append(allSourcePeers, group.Peers...)
}

// add routes for the resource if the peer is in the distribution group
Expand Down

0 comments on commit bb882c8

Please sign in to comment.