libCNI upgraded to v1.1.2

This was all work done previously by @hswong3i in
https://github.com/weaveworks/weave/pull/3939

All credit to them
This commit is contained in:
Raj Chaudhuri committed 2023-03-29 12:10:13 +05:30
1 parent 2f49b8455a
commit 1bb1f02b1d
167 files changed
+15015 -3146

No files matched your search

+13 -3
View File
@@ -3,15 +3,16 @@ package plugin
import (
"crypto/rand"
"encoding/json"
"errors"
"fmt"
"net"
"os"
"strings"
"github.com/containernetworking/cni/pkg/ipam"
"github.com/containernetworking/cni/pkg/skel"
"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/cni/pkg/types/current"
current "github.com/containernetworking/cni/pkg/types/100"
"github.com/containernetworking/plugins/pkg/ipam"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
weaveapi "github.com/weaveworks/weave/api"
@@ -176,8 +177,17 @@ func setupRoutes(link netlink.Link, name string, ipnet net.IPNet, gw net.IP, rou
return nil
}
func (c *CNIPlugin) CmdCheck(args *skel.CmdArgs) error {
// TODO: Figure out how to do a proper CNI check here
// For now, return not implemented error
return errors.New("CNI plugin check not implemented")
}
// As of CNI 0.5 spec:
// "Plugins should generally complete a DEL action without error even if some resources are missing"
//
// "Plugins should generally complete a DEL action without error even if some resources are missing"
//
// this method should therefore return nil in most, if not all, cases.
func (c *CNIPlugin) CmdDel(args *skel.CmdArgs) error {
conf, err := loadNetConf(args.StdinData)