Vendor github.com/containernetworking/cni libcni and pkg file needed for CHECK

Update plugins/tests to deal with changes made to this vendor'ed code
This commit is contained in:
Michael Cambria
2018-11-05 15:33:56 -05:00
parent b93d284d18
commit ddbf22f7f9
14 changed files with 329 additions and 177 deletions

View File

@ -15,6 +15,7 @@
package main
import (
"context"
"encoding/json"
"fmt"
"net"
@ -625,7 +626,7 @@ var _ = Describe("bandwidth test", func() {
defer GinkgoRecover()
containerWithTbfRes, _, err = testutils.CmdAdd(containerWithTbfNS.Path(), "dummy", containerWithTbfIFName, []byte(ptpConf), func() error {
r, err := invoke.DelegateAdd("ptp", []byte(ptpConf), nil)
r, err := invoke.DelegateAdd(context.TODO(), "ptp", []byte(ptpConf), nil)
Expect(r.Print()).To(Succeed())
return err
@ -633,7 +634,7 @@ var _ = Describe("bandwidth test", func() {
Expect(err).NotTo(HaveOccurred())
containerWithoutTbfRes, _, err = testutils.CmdAdd(containerWithoutTbfNS.Path(), "dummy2", containerWithoutTbfIFName, []byte(ptpConf), func() error {
r, err := invoke.DelegateAdd("ptp", []byte(ptpConf), nil)
r, err := invoke.DelegateAdd(context.TODO(), "ptp", []byte(ptpConf), nil)
Expect(r.Print()).To(Succeed())
return err

View File

@ -20,6 +20,7 @@ package main
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io/ioutil"
@ -160,7 +161,7 @@ func delegateAdd(cid, dataDir string, netconf map[string]interface{}) error {
return err
}
result, err := invoke.DelegateAdd(netconf["type"].(string), netconfBytes, nil)
result, err := invoke.DelegateAdd(context.TODO(), netconf["type"].(string), netconfBytes, nil)
if err != nil {
return err
}

View File

@ -19,6 +19,7 @@
package main
import (
"context"
"encoding/json"
"fmt"
"github.com/containernetworking/cni/pkg/invoke"
@ -82,5 +83,5 @@ func doCmdDel(args *skel.CmdArgs, n *NetConf) error {
return fmt.Errorf("failed to parse netconf: %v", err)
}
return invoke.DelegateDel(nc.Type, netconfBytes, nil)
return invoke.DelegateDel(context.TODO(), nc.Type, netconfBytes, nil)
}

View File

@ -16,6 +16,7 @@ package main
import (
"bytes"
"context"
"fmt"
"math/rand"
"net"
@ -121,7 +122,7 @@ var _ = Describe("portmap integration tests", func() {
return nil
}
netDeleted = true
return cniConf.DelNetworkList(configList, &runtimeConfig)
return cniConf.DelNetworkList(context.TODO(), configList, &runtimeConfig)
}
// we'll also manually check the iptables chains
@ -130,7 +131,7 @@ var _ = Describe("portmap integration tests", func() {
dnatChainName := genDnatChain("cni-portmap-unit-test", runtimeConfig.ContainerID).name
// Create the network
resI, err := cniConf.AddNetworkList(configList, &runtimeConfig)
resI, err := cniConf.AddNetworkList(context.TODO(), configList, &runtimeConfig)
Expect(err).NotTo(HaveOccurred())
defer deleteNetwork()