Skip to content

Commit

Permalink
Update CNI dependencies to v1.0.0
Browse files Browse the repository at this point in the history
`IPConfig` in v1.0.0 removes the `Version` field.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
  • Loading branch information
darkowlzz committed Aug 26, 2021
1 parent abd0815 commit da4d1ea
Show file tree
Hide file tree
Showing 7 changed files with 815 additions and 84 deletions.
2 changes: 1 addition & 1 deletion cni/internal/cniutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package internal
import (
"fmt"

"github.com/containernetworking/cni/pkg/types/current"
current "github.com/containernetworking/cni/pkg/types/100"
"github.com/pkg/errors"
)

Expand Down
5 changes: 1 addition & 4 deletions cni/internal/cniutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"net"
"testing"

"github.com/containernetworking/cni/pkg/types/current"
current "github.com/containernetworking/cni/pkg/types/100"
"github.com/containernetworking/cni/pkg/version"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -51,7 +51,6 @@ func TestInterfaceIPs(t *testing.T) {
},
IPs: []*current.IPConfig{
{
Version: "4",
Interface: &vethIndex,
Address: net.IPNet{
IP: net.IPv4(10, 0, 0, 2),
Expand All @@ -60,7 +59,6 @@ func TestInterfaceIPs(t *testing.T) {
Gateway: net.IPv4(10, 0, 0, 1),
},
{
Version: "4",
Interface: &vmIndex,
Address: net.IPNet{
IP: net.IPv4(10, 0, 1, 2),
Expand All @@ -69,7 +67,6 @@ func TestInterfaceIPs(t *testing.T) {
Gateway: net.IPv4(10, 0, 1, 1),
},
{
Version: "4",
Interface: &vethIndex,
Address: net.IPNet{
IP: net.IPv4(192, 168, 0, 2),
Expand Down
2 changes: 1 addition & 1 deletion cni/vmconf/vmconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"strings"

"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/pkg/errors"

Expand Down
3 changes: 1 addition & 2 deletions cni/vmconf/vmconf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/cni/pkg/types/current"
current "github.com/containernetworking/cni/pkg/types/100"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/vishvananda/netlink"
Expand Down Expand Up @@ -69,7 +69,6 @@ func TestIPBootParams(t *testing.T) {
VMIfName: "eth0",
VMMTU: 1337,
VMIPConfig: &current.IPConfig{
Version: "4",
Address: net.IPNet{
IP: net.IPv4(10, 0, 0, 2),
Mask: net.IPv4Mask(255, 255, 255, 0),
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/firecracker-microvm/firecracker-go-sdk
go 1.11

require (
github.com/containerd/fifo v0.0.0-20191213151349-ff969a566b00
github.com/containernetworking/cni v0.8.0
github.com/containernetworking/plugins v0.9.0
github.com/containerd/fifo v1.0.0
github.com/containernetworking/cni v1.0.0
github.com/containernetworking/plugins v1.0.0
github.com/go-openapi/errors v0.20.0
github.com/go-openapi/runtime v0.19.26
github.com/go-openapi/strfmt v0.19.10
Expand All @@ -14,9 +14,9 @@ require (
github.com/gofrs/uuid v3.3.0+incompatible
github.com/hashicorp/go-multierror v1.0.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.0
github.com/sirupsen/logrus v1.8.1
github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c
github.com/stretchr/testify v1.6.1
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852
golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
)
872 changes: 804 additions & 68 deletions go.sum

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/containernetworking/cni/libcni"
"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/pkg/errors"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -549,7 +549,6 @@ func (conf IPConfiguration) ipBootParam() string {
vmConf := vmconf.StaticNetworkConf{
VMNameservers: conf.Nameservers,
VMIPConfig: &current.IPConfig{
Version: "4",
Address: conf.IPAddr,
Gateway: conf.Gateway,
},
Expand Down

0 comments on commit da4d1ea

Please sign in to comment.