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

+10 -2
View File
@@ -2,12 +2,13 @@ package ipamplugin
import (
"encoding/json"
"errors"
"fmt"
"net"
"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"
)
func (i *Ipam) CmdAdd(args *skel.CmdArgs) error {
@@ -22,6 +23,13 @@ func (i *Ipam) CmdAdd(args *skel.CmdArgs) error {
return types.PrintResult(result, conf.CNIVersion)
}
func (i *Ipam) 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")
}
func (i *Ipam) Allocate(args *skel.CmdArgs) (types.Result, error) {
// extract the things we care about
conf, err := loadIPAMConf(args.StdinData)
@@ -52,8 +60,8 @@ func (i *Ipam) Allocate(args *skel.CmdArgs) (types.Result, error) {
return nil, err
}
result := &current.Result{
CNIVersion: current.ImplementedSpecVersion,
IPs: []*current.IPConfig{{
Version: "4",
Address: *ipnet,
Gateway: conf.Gateway,
}},