Skip to content

Commit

Permalink
Update multi-networkpolicy-tc cmd
Browse files Browse the repository at this point in the history
Create Options and Run Server

Signed-off-by: Adrian Chiris <[email protected]>
  • Loading branch information
adrianchiris committed Jul 28, 2022
1 parent 8f8ad38 commit 8c113e8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/multi-networkpolicy-tc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"

"github.com/Mellanox/multi-networkpolicy-tc/pkg/server"
"github.com/Mellanox/multi-networkpolicy-tc/pkg/utils"
)

Expand All @@ -38,16 +39,20 @@ func main() {
ctx := utils.SetupSignalHandler()
initLogs(ctx)
defer klog.Flush()
opts := server.NewOptions()
srv, err := server.NewServer(opts)
if err != nil {
klog.Exit(err)
}

cmd := &cobra.Command{
Use: "multi-networkpolicy-tc",
Long: `TBD`,
Run: func(cmd *cobra.Command, args []string) {
klog.Infof("running multi-networkpolicy-tc")
klog.Infof("waiting for stop signal")
<- ctx.Done()
srv.Run(ctx)
},
}
opts.AddFlags(cmd.Flags())

if err := cmd.Execute(); err != nil {
os.Exit(1)
Expand Down

0 comments on commit 8c113e8

Please sign in to comment.