Skip to content

Commit

Permalink
update Go to version 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Aug 18, 2021
1 parent 6bb118c commit 6e8d5c8
Show file tree
Hide file tree
Showing 3,905 changed files with 87 additions and 1,309,346 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.29
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
GO_VERSION = 1.15
GO_VERSION = 1.16

REGISTRY = kubeovn
DEV_TAG = dev
Expand Down Expand Up @@ -213,20 +213,22 @@ ut:

.PHONY: e2e
e2e:
$(eval NODE_COUNT = $(shell kind get nodes --name kube-ovn | wc -l))
$(eval NETWORK_BRIDGE = $(shell docker inspect -f '{{json .NetworkSettings.Networks.bridge}}' kube-ovn-control-plane))
@if [ '$(NETWORK_BRIDGE)' = 'null' ]; then \
kind get nodes --name kube-ovn | while read node; do \
docker network connect bridge $$node; \
done; \
fi

@printf "package e2e\n\nvar nodeNetworks = map[string]string{\n" > test/e2e/network.go
@kind get nodes --name kube-ovn | while read node; do \
printf "\t\`$$node\`: \`" >> test/e2e/network.go; \
docker inspect -f '{{json .NetworkSettings.Networks.bridge}}' $$node >> test/e2e/network.go; \
printf "\`,\n" >> test/e2e/network.go; \
@echo "{" > test/e2e/network.json
@i=0; kind get nodes --name kube-ovn | while read node; do \
i=$$((i+1)); \
printf '"%s": ' "$$node" >> test/e2e/network.json; \
docker inspect -f "{{json .NetworkSettings.Networks.bridge}}" "$$node" >> test/e2e/network.json; \
if [ $$i -ne $(NODE_COUNT) ]; then echo "," >> test/e2e/network.json; fi; \
done
@echo "}" >> test/e2e/network.go
@echo "}" >> test/e2e/network.json

@if [ ! -n "$$(docker images -q kubeovn/pause:3.2 2>/dev/null)" ]; then docker pull kubeovn/pause:3.2; fi
kind load docker-image --name kube-ovn kubeovn/pause:3.2
Expand All @@ -238,9 +240,7 @@ e2e-ipv6:

.PHONY: e2e-vlan-single-nic
e2e-vlan-single-nic:
@printf "package node\n\nvar networkJSON = []byte(\`" > test/e2e-vlan-single-nic/node/network.go
@docker inspect -f '{{json .NetworkSettings.Networks.kind}}' kube-ovn-control-plane >> test/e2e-vlan-single-nic/node/network.go
@echo "\`)" >> test/e2e-vlan-single-nic/node/network.go
@docker inspect -f '{{json .NetworkSettings.Networks.kind}}' kube-ovn-control-plane > test/e2e-vlan-single-nic/node/network.json
ginkgo -mod=mod -progress -reportPassed --slowSpecThreshold=60 test/e2e-vlan-single-nic

.PHONY: clean
Expand Down
16 changes: 9 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kubeovn/kube-ovn

go 1.12
go 1.16

require (
github.com/Mellanox/sriovnet v1.0.2
Expand All @@ -11,11 +11,9 @@ require (
github.com/coreos/go-iptables v0.4.5
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/elazarl/goproxy v0.0.0-20190630181448-f1e96bc0f4c5 // indirect
github.com/elazarl/goproxy/ext v0.0.0-20190630181448-f1e96bc0f4c5 // indirect
github.com/emicklei/go-restful v2.11.1+incompatible
github.com/go-ini/ini v1.42.0 // indirect
github.com/golang/protobuf v1.4.3
github.com/google/go-cmp v0.5.5 // indirect
github.com/golang/protobuf v1.5.2
github.com/greenpau/ovsdb v0.0.0-20181114004433-3582b85e8968
github.com/hashicorp/go-version v1.2.0 // indirect
github.com/intel/multus-cni v0.0.0-20200313031649-eaf6ff6e20bb
Expand All @@ -25,8 +23,8 @@ require (
github.com/moul/http2curl v1.0.0 // indirect
github.com/neverlee/keymutex v0.0.0-20171121013845-f593aa834bf9
github.com/oilbeater/go-ping v0.0.0-20200413021620-332b7197c5b5
github.com/onsi/ginkgo v1.14.1
github.com/onsi/gomega v1.10.2
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.15.0
github.com/osrg/gobgp v0.0.0-20190401195721-805d02fdfbc5
github.com/parnurzeal/gorequest v0.2.15
github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba // indirect
Expand All @@ -40,8 +38,12 @@ require (
github.com/stretchr/testify v1.6.1
github.com/vishvananda/netlink v1.1.0
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // indirect
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.5 // indirect
google.golang.org/grpc v1.27.1
google.golang.org/protobuf v1.27.1 // indirect
k8s.io/api v0.20.4
k8s.io/apimachinery v0.20.4
k8s.io/client-go v0.20.4
Expand Down
55 changes: 38 additions & 17 deletions go.sum

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions test/e2e-vlan-single-nic/node/network.go

This file was deleted.

File renamed without changes.
4 changes: 4 additions & 0 deletions test/e2e-vlan-single-nic/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package node

import (
"context"
_ "embed"
"encoding/json"
"fmt"
"net"
Expand All @@ -22,6 +23,9 @@ const vlanNic = "eth0"

var vlanBr = util.ExternalBridgeName("provider")

//go:embed network.json
var networkJSON []byte

type nodeNetwork struct {
Gateway string
IPAddress string
Expand Down
43 changes: 25 additions & 18 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package e2e

import (
"context"
_ "embed"
"encoding/json"
"fmt"
"os"
Expand All @@ -24,6 +25,11 @@ import (
"github.com/kubeovn/kube-ovn/test/e2e/underlay"
)

//go:embed network.json
var networkJSON []byte

var nodeNetworks map[string]nodeNetwork

type nodeNetwork struct {
Gateway string
IPAddress string
Expand All @@ -34,6 +40,12 @@ type nodeNetwork struct {
MacAddress string
}

func init() {
if err := json.Unmarshal(networkJSON, &nodeNetworks); err != nil {
panic(err)
}
}

func TestE2e(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Kube-OVN E2E Suite")
Expand Down Expand Up @@ -106,31 +118,26 @@ var _ = SynchronizedBeforeSuite(func() []byte {
var underlayNodeIPs []string
var underlayCIDR, underlayGateway string
for node, network := range nodeNetworks {
var info nodeNetwork
if err = json.Unmarshal([]byte(network), &info); err != nil {
Fail("invalid node network information: " + err.Error())
}

underlay.SetNodeMac(node, info.MacAddress)
if info.IPAddress != "" {
underlay.AddNodeIP(info.IPAddress)
underlayNodeIPs = append(underlayNodeIPs, info.IPAddress)
underlay.AddNodeAddrs(node, fmt.Sprintf("%s/%d", info.IPAddress, info.IPPrefixLen))
underlay.SetNodeMac(node, network.MacAddress)
if network.IPAddress != "" {
underlay.AddNodeIP(network.IPAddress)
underlayNodeIPs = append(underlayNodeIPs, network.IPAddress)
underlay.AddNodeAddrs(node, fmt.Sprintf("%s/%d", network.IPAddress, network.IPPrefixLen))
if underlayCIDR == "" {
underlayCIDR = fmt.Sprintf("%s/%d", info.IPAddress, info.IPPrefixLen)
underlayCIDR = fmt.Sprintf("%s/%d", network.IPAddress, network.IPPrefixLen)
}
}
if info.GlobalIPv6Address != "" {
underlay.AddNodeAddrs(node, fmt.Sprintf("%s/%d", info.GlobalIPv6Address, info.GlobalIPv6PrefixLen))
if network.GlobalIPv6Address != "" {
underlay.AddNodeAddrs(node, fmt.Sprintf("%s/%d", network.GlobalIPv6Address, network.GlobalIPv6PrefixLen))
}
if info.Gateway != "" {
underlay.AddNodeRoutes(node, fmt.Sprintf("default via %s ", info.Gateway))
if network.Gateway != "" {
underlay.AddNodeRoutes(node, fmt.Sprintf("default via %s ", network.Gateway))
if underlayGateway == "" {
underlayGateway = info.Gateway
underlayGateway = network.Gateway
}
}
if info.IPv6Gateway != "" {
underlay.AddNodeRoutes(node, fmt.Sprintf("default via %s ", info.IPv6Gateway))
if network.IPv6Gateway != "" {
underlay.AddNodeRoutes(node, fmt.Sprintf("default via %s ", network.IPv6Gateway))
}
}
underlay.SetCIDR(underlayCIDR)
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/network.go

This file was deleted.

File renamed without changes.
20 changes: 0 additions & 20 deletions vendor/github.com/Mellanox/sriovnet/.travis.yml

This file was deleted.

Loading

0 comments on commit 6e8d5c8

Please sign in to comment.