aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/nfn-operator/nfn-operator.go
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2019-09-27 12:33:48 -0700
committerRitu Sood <ritu.sood@intel.com>2019-09-29 06:48:00 -0700
commit53279580afc48c90cbd28ab61799d9e81e41fffa (patch)
tree0d39c0b0531a1d1d0e0387b99f5130bb85406cf3 /cmd/nfn-operator/nfn-operator.go
parenteae13a54dbdc442a450992f6c4811037ab30daab (diff)
Adding gRPC proto and server
gRPC server is required to send updates to nfn-agent running on all the nodes in the cluster, to setup provider networks as defined in the provider network CR. This patch includes proto file and generated code along with gRPC server code Change-Id: I891629d84932ae662ba7545ebfe4d9921448fdc1 Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Diffstat (limited to 'cmd/nfn-operator/nfn-operator.go')
-rw-r--r--cmd/nfn-operator/nfn-operator.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/cmd/nfn-operator/nfn-operator.go b/cmd/nfn-operator/nfn-operator.go
index 4749506..acd5924 100644
--- a/cmd/nfn-operator/nfn-operator.go
+++ b/cmd/nfn-operator/nfn-operator.go
@@ -10,8 +10,9 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth"
"github.com/spf13/pflag"
- "ovn4nfv-k8s-plugin/pkg/apis"
+ notif "ovn4nfv-k8s-plugin/internal/pkg/nfnNotify"
"ovn4nfv-k8s-plugin/internal/pkg/ovn"
+ "ovn4nfv-k8s-plugin/pkg/apis"
"ovn4nfv-k8s-plugin/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
@@ -48,8 +49,8 @@ func main() {
printVersion()
// Create an OVN Controller
- _, err := ovn.NewOvnController(nil)
- if err != nil {
+ _, err := ovn.NewOvnController(nil)
+ if err != nil {
log.Error(err, "")
os.Exit(1)
}
@@ -61,6 +62,10 @@ func main() {
log.Error(err, "")
os.Exit(1)
}
+
+ // Start GRPC Notification Server
+ go notif.SetupNotifServer(cfg)
+
// Create a new Cmd to provide shared dependencies and start components
mgr, err := manager.New(cfg, manager.Options{})
if err != nil {
@@ -88,4 +93,5 @@ func main() {
log.Error(err, "Manager exited non-zero")
os.Exit(1)
}
+
}