diff options
Diffstat (limited to 'cmd/nfn-agent/nfn-agent.go')
-rw-r--r-- | cmd/nfn-agent/nfn-agent.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cmd/nfn-agent/nfn-agent.go b/cmd/nfn-agent/nfn-agent.go index b2ee630..8e7ad78 100644 --- a/cmd/nfn-agent/nfn-agent.go +++ b/cmd/nfn-agent/nfn-agent.go @@ -1,3 +1,19 @@ +/* + * Copyright 2020 Intel Corporation, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package main import ( @@ -8,6 +24,7 @@ import ( "os/signal" cs "ovn4nfv-k8s-plugin/internal/pkg/cniserver" pb "ovn4nfv-k8s-plugin/internal/pkg/nfnNotify/proto" + chaining "ovn4nfv-k8s-plugin/internal/pkg/utils" "ovn4nfv-k8s-plugin/internal/pkg/ovn" "strings" "syscall" @@ -256,6 +273,18 @@ func handleNotif(msg *pb.Notification) { deleteDirectProvidernetwork(payload) } + case *pb.Notification_ContainterRtInsert: + id := payload.ContainterRtInsert.GetContainerId() + pid, err := chaining.GetPidForContainer(id) + if err != nil { + log.Error(err, "Failed to get pid", "containerID", id) + return + } + err = chaining.ContainerAddRoute(pid, payload.ContainterRtInsert.GetRoute()) + if err != nil { + return + } + case *pb.Notification_InSync: if payload.InSync.GetNodeIntfIpAddress() != "" && payload.InSync.GetNodeIntfMacAddress() != "" { err := createNodeOVSInternalPort(payload) |