Skip to content

Commit

Permalink
Merge pull request #68 from adrianchiris/bump-cni-and-plugins
Browse files Browse the repository at this point in the history
Bump cni and cni plugins pkgs
  • Loading branch information
ykulazhenkov authored Feb 27, 2023
2 parents f5a8bdd + c63fd8a commit 3c3a623
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 80 deletions.
3 changes: 2 additions & 1 deletion cmd/accelerated-bridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ func setupLogger() {
func main() {
setupLogger()
p := plugin.NewPlugin()
skel.PluginMain(p.CmdAdd, p.CmdCheck, p.CmdDel, version.All, "")
skel.PluginMain(p.CmdAdd, p.CmdCheck, p.CmdDel,
version.PluginSupports("0.1.0", "0.2.0", "0.3.0", "0.3.1", "0.4.0"), "")
}
34 changes: 16 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,31 @@ go 1.18

require (
github.com/Mellanox/sriovnet v1.1.0
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.8.7
github.com/containernetworking/cni v1.1.2
github.com/containernetworking/plugins v1.2.0
github.com/gofrs/flock v0.8.1
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.24.2
github.com/rs/zerolog v1.20.0
github.com/spf13/afero v1.6.0
github.com/stretchr/testify v1.7.0
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6
github.com/vishvananda/netlink v1.2.1-beta.2
)

require (
github.com/coreos/go-iptables v0.4.5 // indirect
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/coreos/go-iptables v0.6.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/hpcloud/tail v1.0.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8 // indirect
github.com/safchain/ethtool v0.2.0 // indirect
github.com/stretchr/objx v0.1.0 // indirect
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/text v0.3.8 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.5.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
139 changes: 87 additions & 52 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/plugin/cmdcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package plugin

import (
"github.com/containernetworking/cni/pkg/skel"
"github.com/containernetworking/cni/pkg/types/current"
current "github.com/containernetworking/cni/pkg/types/100"
"github.com/containernetworking/plugins/pkg/ns"

localtypes "github.com/k8snetworkplumbingwg/accelerated-bridge-cni/pkg/types"
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package plugin

import (
"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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/mocks/IPAM.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"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/ns"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -149,7 +149,7 @@ func (p *Plugin) CmdAdd(args *skel.CmdArgs) error {
log.Error().Msgf("failed to update DeviceInfo %v.", err)
// this step is not critical for CNI operation, log error and continue
}
return types.PrintResult(cmdCtx.result, current.ImplementedSpecVersion)
return types.PrintResult(cmdCtx.result, pluginConf.CNIVersion)
}

// updateDeviceInfo updates CNIDeviceInfoFile file with information
Expand Down
7 changes: 3 additions & 4 deletions pkg/plugin/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"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/ns"
"github.com/stretchr/testify/mock"

Expand Down Expand Up @@ -53,7 +53,7 @@ var (
func getValidPluginConf() *localtypes.PluginConf {
return &localtypes.PluginConf{
NetConf: localtypes.NetConf{
NetConf: types.NetConf{IPAM: testValidIPAM, Name: testValidName},
NetConf: types.NetConf{CNIVersion: "0.4.0", IPAM: testValidIPAM, Name: testValidName},
Bridge: testValidBridge,
Debug: true,
DeviceID: testValidDeviceID,
Expand Down Expand Up @@ -81,12 +81,11 @@ func getValidCmdArgs() *skel.CmdArgs {
func getValidIPAMResult() types.Result {
_, ipNet, _ := net.ParseCIDR("192.168.100.101/24")
ipConf := current.IPConfig{
Version: "4",
Address: *ipNet,
Gateway: net.ParseIP("192.168.100.1"),
}
return &current.Result{
CNIVersion: "0.2.0",
CNIVersion: "1.0.0",
IPs: []*current.IPConfig{&ipConf},
}
}
Expand Down

0 comments on commit 3c3a623

Please sign in to comment.