Skip to content

Commit

Permalink
Update CNI dependency 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 7b7e66b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 59 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.11

require (
github.com/containerd/fifo v0.0.0-20191213151349-ff969a566b00
github.com/containernetworking/cni v0.8.0
github.com/containernetworking/cni v1.0.0
github.com/containernetworking/plugins v0.9.0
github.com/go-openapi/errors v0.20.0
github.com/go-openapi/runtime v0.19.26
Expand Down
59 changes: 11 additions & 48 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 7b7e66b

Please sign in to comment.