From cdcf5808db7690419778c0ba194326f160aa3120 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Wed, 30 Nov 2016 10:43:50 +0000 Subject: [PATCH] Remove CNI support from Docker plugin --- prog/plugin/main.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/prog/plugin/main.go b/prog/plugin/main.go index cf6d0ad0..5c3c368c 100644 --- a/prog/plugin/main.go +++ b/prog/plugin/main.go @@ -11,7 +11,6 @@ import ( "strings" "syscall" - cni "github.com/appc/cni/pkg/skel" "github.com/docker/libnetwork/ipamapi" weaveapi "github.com/weaveworks/weave/api" "github.com/weaveworks/weave/common" @@ -29,8 +28,6 @@ var Log = common.Log func main() { var ( justVersion bool - cniNet bool - cniIpam bool address string meshAddress string logLevel string @@ -38,8 +35,6 @@ func main() { ) flag.BoolVar(&justVersion, "version", false, "print version and exit") - flag.BoolVar(&cniNet, "cni-net", false, "act as a CNI network plugin") - flag.BoolVar(&cniIpam, "cni-ipam", false, "act as a CNI IPAM plugin") flag.StringVar(&logLevel, "log-level", "info", "logging level (debug, info, warning, error)") flag.StringVar(&address, "socket", "/run/docker/plugins/weave.sock", "socket on which to listen") flag.StringVar(&meshAddress, "meshsocket", "/run/docker/plugins/weavemesh.sock", "socket on which to listen in mesh mode") @@ -56,17 +51,6 @@ func main() { weave := weaveapi.NewClient(os.Getenv("WEAVE_HTTP_ADDR"), Log) - switch { - case cniIpam || strings.HasSuffix(os.Args[0], "weave-ipam"): - i := ipamplugin.NewIpam(weave) - cni.PluginMain(i.CmdAdd, i.CmdDel) - os.Exit(0) - case cniNet || strings.HasSuffix(os.Args[0], "weave-net"): - n := netplugin.NewCNIPlugin(weave) - cni.PluginMain(n.CmdAdd, n.CmdDel) - os.Exit(0) - } - // API 1.21 is the first version that supports docker network commands dockerClient, err := docker.NewVersionedClientFromEnv("1.21") if err != nil {