6 "github.com/sirupsen/logrus"
7 "github.com/urfave/cli"
9 cni "ovn4nfv-k8s-plugin/internal/pkg/cnishim"
10 "ovn4nfv-k8s-plugin/internal/pkg/config"
12 "github.com/containernetworking/cni/pkg/skel"
13 "github.com/containernetworking/cni/pkg/types"
14 "github.com/containernetworking/cni/pkg/version"
15 "github.com/containernetworking/plugins/pkg/utils/buildversion"
19 logrus.Infof("ovn4nfvk8s-cni shim cni")
21 c.Name = "ovn4nfvk8s-cni"
22 c.Usage = "a CNI plugin to set up or tear down a additional interfaces with OVN"
24 c.Flags = config.Flags
26 ep := cni.CNIEndpoint("")
27 c.Action = func(ctx *cli.Context) error {
28 if _, err := config.InitConfig(ctx); err != nil {
36 buildversion.BuildString("ovn4nfv-k8s shim cni"))
41 if err := c.Run(os.Args); err != nil {
42 // Print the error to stdout in conformance with the CNI spec
43 e, ok := err.(*types.Error)
45 e = &types.Error{Code: 100, Msg: err.Error()}