CNI net plugin

This commit is contained in:
Bryan Boreham committed 2016-03-17 12:41:14 +00:00
1 parent 08059412b5
commit 42ff61f97c
4 files changed
+169 -1

No files matched your search

+7 -1
View File
@@ -7,6 +7,7 @@ import (
"net/http"
"os"
"os/signal"
"strings"
"syscall"
cni "github.com/appc/cni/pkg/skel"
@@ -48,10 +49,15 @@ func main() {
weave := weaveapi.NewClient(os.Getenv("WEAVE_HTTP_ADDR"), Log)
if os.Args[0] == "weave-ipam" {
switch {
case strings.HasSuffix(os.Args[0], "weave-ipam"):
i := ipamplugin.NewIpam(weave)
cni.PluginMain(i.CmdAdd, i.CmdDel)
os.Exit(0)
case strings.HasSuffix(os.Args[0], "weave"):
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