[management merge only unique entries on network map merge (#3277)

This commit is contained in:
Pascal Fischer
2025-02-05 16:50:45 +01:00
committed by GitHub
parent b2a5b29fb2
commit 035c5d9f23
13 changed files with 216 additions and 19 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"reflect"
runtime "runtime"
"runtime"
"time"
"github.com/hashicorp/go-multierror"
@@ -290,7 +290,7 @@ func (c *clientNetwork) recalculateRouteAndUpdatePeerAndSystem() error {
// If the chosen route is the same as the current route, do nothing
if c.currentChosen != nil && c.currentChosen.ID == newChosenID &&
c.currentChosen.IsEqual(c.routes[newChosenID]) {
c.currentChosen.Equal(c.routes[newChosenID]) {
return nil
}

View File

@@ -40,7 +40,7 @@ func (m *serverRouter) updateRoutes(routesMap map[route.ID]*route.Route) error {
for routeID := range m.routes {
update, found := routesMap[routeID]
if !found || !update.IsEqual(m.routes[routeID]) {
if !found || !update.Equal(m.routes[routeID]) {
serverRoutesToRemove = append(serverRoutesToRemove, routeID)
}
}