Skip to content

Commit

Permalink
Don't filter-out looped connections.
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Guschin <[email protected]>
  • Loading branch information
Vitaliy Guschin committed Feb 13, 2024
1 parent 830602c commit c38f225
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func updateConnections(logger log.Logger, nsmgrAddr string, event *networkservic
addManagerConnection(nsmgrAddr, connectionID)
}
}
parceConnectionsToGraphicalModel(logger)
parceConnectionsToGraphicalModel()
}

func cleanupManager(logger log.Logger, nsmgrAddr string) {
Expand All @@ -192,7 +192,7 @@ func cleanupManager(logger log.Logger, nsmgrAddr string) {
})
managerConnections.Delete(nsmgrAddr)
nsmgrs.Delete(nsmgrAddr)
parceConnectionsToGraphicalModel(logger)
parceConnectionsToGraphicalModel()
}

func configureAndRunRESTServer() {
Expand Down
10 changes: 1 addition & 9 deletions model_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/edwarnicke/genericsync"

"github.com/networkservicemesh/api/pkg/api/networkservice"
"github.com/networkservicemesh/sdk/pkg/tools/log"
)

func updateStorage(nodes []Node, edges []Edge) {
Expand All @@ -51,7 +50,7 @@ func removeManagerConnection(mgr, conn string) {
}
}

func parceConnectionsToGraphicalModel(logger log.Logger) {
func parceConnectionsToGraphicalModel() {
nodeMap := make(map[string]Node)
var edges []Edge

Expand All @@ -69,13 +68,6 @@ func parceConnectionsToGraphicalModel(logger log.Logger) {

// Create all path segment nodes, interfaces and interface connections
pathSegments := conn.GetPath().GetPathSegments()

// Skip looped endpoint-endpoint connections (vl3 scenario)
if pathSegments[0].GetName() == pathSegments[len(pathSegments)-1].GetName() {
logger.Infof("Connection %q looped on %q is skipped from conversion to graphical model.", connectionID, pathSegments[0].GetName())
return true
}

var previousInterfaceID string
for _, segment := range pathSegments {
segmentType := getPathSegmentType(segment.GetName())
Expand Down

0 comments on commit c38f225

Please sign in to comment.