Fix vppagent-nsc to use NewMechanism
This ensures netNsInode tagging,
and thus showing up in skydive.
@@ -18,7 +18,6 @@ import (
"context"
"os"
"os/signal"
- "path"
"sync"
"syscall"
"time"
@@ -68,7 +67,10 @@ func main() {
// Init related activities start here
nsmConnectionClient := networkservice.NewNetworkServiceClient(conn)
-
+ mechanism, err := connection.NewMechanism(connection.MechanismType_MEM_INTERFACE, "icmp-responder", "vppagent-nsc")
+ if err != nil {
+ logrus.Fatalf("Failed to create mechanism:", err)
+ }
request := &networkservice.NetworkServiceRequest{
Connection: &connection.Connection{
@@ -79,13 +81,7 @@ func main() {
Labels: make(map[string]string),
},
MechanismPreferences: []*connection.Mechanism{
- {
- Type: connection.MechanismType_MEM_INTERFACE,
- Parameters: map[string]string{
- connection.InterfaceNameKey: "icmp-responder",
- connection.SocketFilename: path.Join("icmp-responder", "memif.sock"),
- },
- },
+ mechanism,
},
}
