Skip to content

Commit 6fff085

Browse files
authored
Merge pull request #431 from SchSeba/bump_to_golang_1.18_k8s_1.24
Bump golang 1.18 and k8s 1.24
2 parents 0f79c0e + 8c4724c commit 6fff085

File tree

2,198 files changed

+299450
-60830
lines changed

Some content is hidden

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

2,198 files changed

+299450
-60830
lines changed

.github/workflows/build-test-lint.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ jobs:
55
name: build
66
strategy:
77
matrix:
8-
go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x]
8+
go-version: [1.17.x, 1.18.x]
99
goarch: [amd64]
1010
os: [ubuntu-latest]
1111
runs-on: ${{ matrix.os }}
1212
steps:
13-
- name: Set up Go 1.13
14-
uses: actions/setup-go@v1
13+
- name: Set up Go matrix
14+
uses: actions/setup-go@v3
1515
with:
1616
go-version: ${{ matrix.go-version }}
1717

@@ -30,9 +30,9 @@ jobs:
3030
name: test
3131
steps:
3232
- name: Set up Go
33-
uses: actions/setup-go@v1
33+
uses: actions/setup-go@v3
3434
with:
35-
go-version: 1.16.x
35+
go-version: 1.18.x
3636

3737
- name: Check out code into the Go module directory
3838
uses: actions/checkout@v2
@@ -49,9 +49,9 @@ jobs:
4949
name: test-coverage
5050
steps:
5151
- name: Set up Go
52-
uses: actions/setup-go@v1
52+
uses: actions/setup-go@v3
5353
with:
54-
go-version: 1.16.x
54+
go-version: 1.18.x
5555

5656
- uses: actions/checkout@v2
5757

@@ -72,15 +72,15 @@ jobs:
7272
runs-on: ubuntu-latest
7373
steps:
7474
- name: Set up Go
75-
uses: actions/setup-go@v1
75+
uses: actions/setup-go@v3
7676
with:
77-
go-version: 1.16.x
77+
go-version: 1.18.x
7878
- uses: actions/checkout@v2
7979
- name: golangci-lint
8080
uses: golangci/golangci-lint-action@v3
8181
with:
8282
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
83-
version: v1.37
83+
version: v1.46.2
8484

8585
shellcheck:
8686
name: Shellcheck
@@ -111,9 +111,9 @@ jobs:
111111
- uses: actions/checkout@v2
112112

113113
- name: Set up Go
114-
uses: actions/setup-go@v2
114+
uses: actions/setup-go@v3
115115
with:
116-
go-version: 1.16.x
116+
go-version: 1.18.x
117117

118118
# if this fails, run go mod tidy
119119
- name: Check if module files are consistent with code

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ GOCOV = $(GOBIN)/gocov
1212
GOCOVXML = $(GOBIN)/gocov-xml
1313
GCOV2LCOV = $(GOBIN)/gcov2lcov
1414
GO2XUNIT = $(GOBIN)/go2xunit
15+
GOMOCKERY = $(GOBIN)/mockery
1516
# Package info
1617
BINARY_NAME=sriovdp
1718
PACKAGE=sriov-network-device-plugin
@@ -90,6 +91,9 @@ $(GOCOVXML): | $(BASE) ; $(info building gocov-xml...)
9091
$(GO2XUNIT): | $(BASE) ; $(info building go2xunit...)
9192
$Q go install github.com/tebeka/go2xunit@latest
9293

94+
$(GOMOCKERY): | $(BASE) ; $(info building go2xunit...)
95+
$Q go install github.com/vektra/mockery/v2@latest
96+
9397
TEST_TARGETS := test-default test-bench test-short test-verbose test-race
9498
.PHONY: $(TEST_TARGETS) test-xml check test tests
9599
test-bench: ARGS=-run=__absolutelynothing__ -bench=. ## Run benchmarks
@@ -151,6 +155,12 @@ clean: ; $(info Cleaning...) @ ## Cleanup everything
151155
@rm -rf $(GOBIN)
152156
@rm -rf test/
153157

158+
.PHONY: mockery
159+
mockery: | $(BASE) $(GOMOCKERY) ; $(info Running mockery...) @ ## Run golint on all source files
160+
# $Q cd $(BASE)/pkg/types && rm -rf mocks && $(GOMOCKERY) --all 2>/dev/null
161+
$Q $(GOMOCKERY) --name=".*" --dir=pkg/types --output=pkg/types/mocks --recursive=false --log-level=debug
162+
$Q $(GOMOCKERY) --name=".*" --dir=pkg/utils --output=pkg/utils/mocks --recursive=false --log-level=debug
163+
154164
.PHONY: help
155165
help: ; @ ## Display this help message
156166
@grep -E '^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \

cmd/sriovdp/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package main
1717
import (
1818
"encoding/json"
1919
"fmt"
20-
"io/ioutil"
20+
"os"
2121

2222
"github.com/golang/glog"
2323
"github.com/jaypipes/ghw"
@@ -70,7 +70,7 @@ func newResourceManager(cp *cliParams) *resourceManager {
7070
// readConfig reads and validate configurations from Config file
7171
func (rm *resourceManager) readConfig() error {
7272
resources := &types.ResourceConfList{}
73-
rawBytes, err := ioutil.ReadFile(rm.configFile)
73+
rawBytes, err := os.ReadFile(rm.configFile)
7474

7575
if err != nil {
7676
return fmt.Errorf("error reading file %s, %v", rm.configFile, err)

cmd/sriovdp/manager_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package main
1616

1717
import (
1818
"fmt"
19-
"io/ioutil"
2019
"os"
2120
"testing"
2221

@@ -65,7 +64,7 @@ var _ = Describe("Resource manager", func() {
6564
if err != nil {
6665
panic(err)
6766
}
68-
_ = ioutil.WriteFile("/tmp/sriovdp/test_config", []byte("junk"), 0644)
67+
_ = os.WriteFile("/tmp/sriovdp/test_config", []byte("junk"), 0644)
6968
})
7069
AfterEach(func() {
7170
err := os.RemoveAll("/tmp/sriovdp")
@@ -88,7 +87,7 @@ var _ = Describe("Resource manager", func() {
8887
if testErr != nil {
8988
panic(testErr)
9089
}
91-
testErr = ioutil.WriteFile("/tmp/sriovdp/test_config", []byte(`{
90+
testErr = os.WriteFile("/tmp/sriovdp/test_config", []byte(`{
9291
"resourceList": [{
9392
"resourceName": "intel_sriov_netdevice",
9493
"selectors": {
@@ -159,7 +158,7 @@ var _ = Describe("Resource manager", func() {
159158
if err != nil {
160159
panic(err)
161160
}
162-
err = ioutil.WriteFile("/tmp/sriovdp/test_config", []byte(`{
161+
err = os.WriteFile("/tmp/sriovdp/test_config", []byte(`{
163162
"resourceList": [{
164163
"resourceName": "invalid-name",
165164
"selectors": {
@@ -186,7 +185,7 @@ var _ = Describe("Resource manager", func() {
186185
if err != nil {
187186
panic(err)
188187
}
189-
err = ioutil.WriteFile("/tmp/sriovdp/test_config", []byte(`{
188+
err = os.WriteFile("/tmp/sriovdp/test_config", []byte(`{
190189
"resourceList": [{
191190
"resourceName": "duplicate",
192191
"selectors": {
@@ -220,7 +219,7 @@ var _ = Describe("Resource manager", func() {
220219
if err != nil {
221220
panic(err)
222221
}
223-
err = ioutil.WriteFile("/tmp/sriovdp/test_config", []byte(`{
222+
err = os.WriteFile("/tmp/sriovdp/test_config", []byte(`{
224223
"resourceList": [{
225224
"resourceName": "wrong_config",
226225
"selectors": {

go.mod

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/k8snetworkplumbingwg/sriov-network-device-plugin
22

3-
go 1.13
3+
go 1.17
44

55
require (
66
github.com/Mellanox/rdmamap v1.0.0
@@ -10,17 +10,70 @@ require (
1010
github.com/jaypipes/pcidb v0.5.0
1111
github.com/k8snetworkplumbingwg/govdpa v0.1.3
1212
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.1-0.20201119153432-9d213757d22d
13-
github.com/onsi/ginkgo v1.12.0
14-
github.com/onsi/gomega v1.9.0
13+
github.com/onsi/ginkgo v1.14.0
14+
github.com/onsi/gomega v1.10.1
1515
github.com/pkg/errors v0.9.1
1616
github.com/stretchr/testify v1.7.1
1717
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6
18-
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
19-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
20-
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
18+
google.golang.org/grpc v1.40.0
19+
k8s.io/kubelet v0.24.0
20+
)
21+
22+
require (
23+
github.com/PuerkitoBio/purell v1.1.1 // indirect
24+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
25+
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
26+
github.com/containernetworking/cni v0.7.1 // indirect
27+
github.com/davecgh/go-spew v1.1.1 // indirect
28+
github.com/emicklei/go-restful v2.10.0+incompatible // indirect
29+
github.com/fsnotify/fsnotify v1.4.9 // indirect
30+
github.com/ghodss/yaml v1.0.0 // indirect
31+
github.com/go-logr/logr v1.2.0 // indirect
32+
github.com/go-ole/go-ole v1.2.4 // indirect
33+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
34+
github.com/go-openapi/jsonreference v0.19.5 // indirect
35+
github.com/go-openapi/swag v0.19.14 // indirect
36+
github.com/gogo/protobuf v1.3.2 // indirect
37+
github.com/golang/protobuf v1.5.2 // indirect
38+
github.com/google/gnostic v0.5.7-v3refs // indirect
39+
github.com/google/gofuzz v1.1.0 // indirect
40+
github.com/google/uuid v1.1.2 // indirect
41+
github.com/josharian/intern v1.0.0 // indirect
42+
github.com/json-iterator/go v1.1.12 // indirect
43+
github.com/mailru/easyjson v0.7.6 // indirect
44+
github.com/mitchellh/go-homedir v1.0.0 // indirect
45+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
46+
github.com/modern-go/reflect2 v1.0.2 // indirect
47+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
48+
github.com/nxadm/tail v1.4.4 // indirect
49+
github.com/pmezard/go-difflib v1.0.0 // indirect
50+
github.com/spf13/afero v1.4.1 // indirect
51+
github.com/stretchr/objx v0.2.0 // indirect
52+
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect
53+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
54+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
55+
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
56+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
2157
golang.org/x/text v0.3.7 // indirect
22-
google.golang.org/grpc v1.28.1
23-
k8s.io/kubelet v0.18.1
58+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
59+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
60+
google.golang.org/appengine v1.6.7 // indirect
61+
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 // indirect
62+
google.golang.org/protobuf v1.27.1 // indirect
63+
gopkg.in/inf.v0 v0.9.1 // indirect
64+
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
65+
gopkg.in/yaml.v2 v2.4.0 // indirect
66+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
67+
howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
68+
k8s.io/api v0.24.0 // indirect
69+
k8s.io/apimachinery v0.24.0 // indirect
70+
k8s.io/client-go v0.24.0 // indirect
71+
k8s.io/klog/v2 v2.60.1 // indirect
72+
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
73+
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
74+
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
75+
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
76+
sigs.k8s.io/yaml v1.2.0 // indirect
2477
)
2578

2679
replace (

0 commit comments

Comments
 (0)