Skip to content

Commit ee7538c

Browse files
authored
chore: update to go1.16 (#887)
* chore: update to go1.16 for embed * chore: update github.com/docker/libnetwork dependency to fix logrus package casing issue * feat: move build-time binary dependencies to build/tools and compile locally Signed-off-by: Evan Baker <[email protected]>
1 parent fda89d0 commit ee7538c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+7759
-373
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ ipam-*.xml
2121
# debug test files
2222
*.test
2323

24-
controller-gen
24+
build/tools/bin

.pipelines/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu/ bionic multiverse" | sudo tee -a
1111
RUN echo "deb http://archive.ubuntu.com/ubuntu/ bionic universe" | sudo tee -a /etc/apt/sources.list
1212
RUN echo "deb http://archive.ubuntu.com/ubuntu/ bionic main" | sudo tee -a /etc/apt/sources.list
1313
RUN apt-get update && apt-get install -y iptables ipset iproute2 ebtables
14-
RUN wget -qO- https://golang.org/dl/go1.15.linux-amd64.tar.gz | tar zxf - -C /usr/lib/
14+
RUN wget -qO- https://golang.org/dl/go1.16.linux-amd64.tar.gz | tar zxf - -C /usr/lib/
1515
ENV PATH="/usr/lib/go/bin/:${PATH}"
1616
ENV GOROOT="/usr/lib/go"
1717
ENV GOPATH="/root/go"
@@ -22,4 +22,4 @@ RUN go get github.com/jstemmer/go-junit-report
2222
RUN go get github.com/axw/gocov/gocov
2323
RUN go get github.com/AlekSi/gocov-xml
2424
RUN go get -u gopkg.in/matm/v1/gocov-html
25-
RUN go get -u github.com/onsi/ginkgo/ginkgo
25+
RUN go get -u github.com/onsi/ginkgo/ginkgo

.pipelines/pipeline.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,31 +177,21 @@ stages:
177177
steps:
178178

179179
- script: |
180-
go env
181-
export PATH=$HOME/go/bin:$PATH
182-
go get github.com/docker/libnetwork/driverapi
183-
go get github.com/gorilla/mux
184-
go get github.com/jstemmer/go-junit-report
185-
go get github.com/axw/gocov/gocov
186-
go get github.com/AlekSi/gocov-xml
187-
go get github.com/matm/gocov-html
188-
go get github.com/rakyll/gotest
189-
180+
make tools
190181
# run test, echo exit status code to fd 3, pipe output from test to tee, which splits output to stdout and go-junit-report (which converts test output to report.xml), stdout from tee is redirected to fd 4. Take output written to fd 3 (which is the exit code of test), redirect to stdout, pipe to read from stdout then exit with that status code. Read all output from fd 4 (output from tee) and write to top stdout
191182
{ { { {
192183
sudo -E env "PATH=$PATH" make test-all;
193184
echo $? >&3;
194-
} | tee >(go-junit-report > report.xml) >&4;
185+
} | tee >(build/tools/bin/go-junit-report > report.xml) >&4;
195186
} 3>&1;
196187
} | { read xs; exit $xs; }
197188
} 4>&1
198189
name: "Test"
199190
displayName: "Run Tests"
200191
201192
- bash: |
202-
export PATH=$HOME/go/bin:$PATH
203-
gocov convert coverage.out > coverage.json
204-
gocov-xml < coverage.json > coverage.xml
193+
build/tools/bin/gocov convert coverage.out > coverage.json
194+
build/tools/bin/gocov-xml < coverage.json > coverage.xml
205195
name: "Coverage"
206196
displayName: "Generate Coverage Reports"
207197
condition: always()

Makefile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,27 @@ $(TOOLS_DIR)/go.mod:
480480
cd $(TOOLS_DIR); go mod init && go mod tidy
481481

482482
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
483-
$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod # Build controller-gen
483+
$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod
484484
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen
485485

486-
controller-gen: $(CONTROLLER_GEN)
486+
controller-gen: $(CONTROLLER_GEN) ## Build controller-gen
487+
488+
GOCOV := $(TOOLS_BIN_DIR)/gocov
489+
$(GOCOV): $(TOOLS_DIR)/go.mod
490+
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/gocov github.com/axw/gocov/gocov
491+
492+
gocov: $(GOCOV) ## Build gocov
493+
494+
GOCOV_XML := $(TOOLS_BIN_DIR)/gocov-xml
495+
$(GOCOV_XML): $(TOOLS_DIR)/go.mod
496+
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/gocov-xml github.com/AlekSi/gocov-xml
497+
498+
gocov-xml: $(GOCOV_XML) ## Build gocov-xml
499+
500+
GO_JUNIT_REPORT := $(TOOLS_BIN_DIR)/go-junit-report
501+
$(GO_JUNIT_REPORT): $(TOOLS_DIR)/go.mod
502+
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/go-junit-report github.com/jstemmer/go-junit-report
503+
504+
go-junit-report: $(GO_JUNIT_REPORT) ## Build go-junit-report
505+
506+
tools: gocov gocov-xml go-junit-report ## Build bins for built tools

build/tools/go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ module github.com/azure/azure-container-networking/build/tools
22

33
go 1.16
44

5-
require sigs.k8s.io/controller-tools v0.3.0
5+
require (
6+
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737
7+
github.com/axw/gocov v1.0.0
8+
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
9+
sigs.k8s.io/controller-tools v0.3.0
10+
)

build/tools/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
22
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
33
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
44
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
5+
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737 h1:JZHBkt0GhM+ARQykshqpI49yaWCHQbJonH3XpDTwMZQ=
6+
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737/go.mod h1:w1KSuh2JgIL3nyRiZijboSUwbbxOrTzWwyWVFUHtXBQ=
57
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
68
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
79
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
@@ -41,6 +43,8 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5
4143
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
4244
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
4345
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
46+
github.com/axw/gocov v1.0.0 h1:YsqYR66hUmilVr23tu8USgnJIJvnwh3n7j5zRn7x4LU=
47+
github.com/axw/gocov v1.0.0/go.mod h1:LvQpEYiwwIb2nYkXY2fDWhg9/AsYqkhmrCshjlUJECE=
4448
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
4549
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
4650
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=

build/tools/tools.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
package tools
44

55
import (
6+
_ "github.com/AlekSi/gocov-xml"
7+
_ "github.com/axw/gocov/gocov"
8+
_ "github.com/jstemmer/go-junit-report"
69
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
710
)

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/Azure/azure-container-networking
22

3-
go 1.13
3+
go 1.16
44

55
require (
66
code.cloudfoundry.org/clock v1.0.0 // indirect
@@ -9,42 +9,42 @@ require (
99
github.com/Microsoft/hcsshim v0.8.10-0.20200506181021-222e9efadbe0
1010
github.com/billgraziano/dpapi v0.3.0
1111
github.com/containernetworking/cni v0.7.0-rc2
12-
github.com/docker/libnetwork v0.5.6
12+
github.com/docker/go-connections v0.4.0 // indirect
13+
github.com/docker/libnetwork v0.8.0-dev.2.0.20210525090646-64b7a4574d14
1314
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
1415
github.com/google/uuid v1.1.1
1516
github.com/gorilla/mux v1.8.0
16-
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
1717
github.com/hashicorp/golang-lru v0.5.3 // indirect
1818
github.com/imdario/mergo v0.3.8 // indirect
19+
github.com/ishidawataru/sctp v0.0.0-20210226210310-f2269e66cdee // indirect
1920
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
21+
github.com/kr/pretty v0.2.0 // indirect
2022
github.com/microsoft/ApplicationInsights-Go v0.4.3
2123
github.com/nxadm/tail v1.4.5
2224
github.com/onsi/ginkgo v1.12.0
2325
github.com/onsi/gomega v1.9.0
24-
github.com/petar/GoLLRB v0.0.0-20190514000832-33fb24c13b99 // indirect
2526
github.com/prometheus/client_golang v1.0.0
2627
github.com/prometheus/client_model v0.2.0
2728
github.com/spf13/cobra v0.0.5
2829
github.com/spf13/pflag v1.0.5
2930
github.com/spf13/viper v1.3.2
3031
github.com/stretchr/testify v1.7.0
32+
github.com/vishvananda/netlink v1.1.0 // indirect
33+
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
3134
go.opencensus.io v0.22.2 // indirect
3235
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
3336
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
3437
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
3538
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
36-
golang.org/x/text v0.3.6 // indirect
3739
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
38-
golang.org/x/tools v0.1.1 // indirect
3940
google.golang.org/appengine v1.6.5 // indirect
40-
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
4141
google.golang.org/grpc v1.27.0
4242
google.golang.org/protobuf v1.25.0
43+
gotest.tools/v3 v3.0.2 // indirect
4344
k8s.io/api v0.18.19
4445
k8s.io/apimachinery v0.18.19
4546
k8s.io/client-go v0.18.19
4647
k8s.io/klog v1.0.0
4748
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
4849
sigs.k8s.io/controller-runtime v0.6.0
49-
software.sslmate.com/src/go-pkcs12 v0.0.0-20201102150903-66718f75db0e // indirect
5050
)

0 commit comments

Comments
 (0)