aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorRitu Sood <Ritu.Sood@intel.com>2020-05-06 13:47:11 -0700
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>2020-09-17 17:09:13 -0700
commit178b11bcf11accdf57f0d79509d80000fafbe05c (patch)
tree045246cfedc4d1639447d338e63459c63c1246c7 /cmd
parentce14abc0128d4c55a7805c52ea199e2ce6159428 (diff)
Route based chaining
1) Adding controller for route based chaining 2) nfn agent code to insert route in container namespace 3) Calculate routes based on the Chaining Routes Based on the Ritu(ovn4nfv-k8s-plugin committer) patches Co-authored-by: Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> Signed-off-by: Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> Change-Id: I6757f269a5df7d98d650f273468c6ccbcc055d3e
Diffstat (limited to 'cmd')
-rw-r--r--cmd/nfn-agent/nfn-agent.go29
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)