Skip to content

Commit 356a34c

Browse files
committed
2 parents d394308 + 3941954 commit 356a34c

File tree

11 files changed

+468
-257
lines changed

11 files changed

+468
-257
lines changed

.github/workflows/buildtest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
build-test:
1010
strategy:
1111
matrix:
12-
go-version: [1.24.x]
12+
go-version: [1.25.x]
1313
os: [ubuntu-24.04]
1414
goos: [linux]
1515
goarch: [amd64, arm64, ppc64le, s390x]
@@ -60,7 +60,7 @@ jobs:
6060
- name: Set up Go
6161
uses: actions/setup-go@v6
6262
with:
63-
go-version: 1.24.x
63+
go-version: 1.25.x
6464

6565
- name: Check out code
6666
uses: actions/checkout@v6

.github/workflows/static-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Set up Go
99
uses: actions/setup-go@v6
1010
with:
11-
go-version: "1.24"
11+
go-version: "1.25.x"
1212
- uses: actions/checkout@v6
1313
- name: run make lint
1414
run: make lint

.golangci.yml

Lines changed: 99 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,122 @@
1-
run:
2-
timeout: 3m
1+
# Tested with golangci-lint ver. 2.x
2+
version: "2"
33

4-
linters-settings:
5-
dupl:
6-
threshold: 100
7-
funlen:
8-
lines: 100
9-
statements: 50
10-
goconst:
11-
min-len: 2
12-
min-occurrences: 2
13-
gocritic:
14-
enabled-tags:
15-
- diagnostic
16-
- experimental
17-
- opinionated
18-
- performance
19-
- style
20-
disabled-checks:
21-
- dupImport # https://github.com/go-critic/go-critic/issues/845
22-
- ifElseChain
23-
- octalLiteral
24-
- whyNoLint
25-
- wrapperFunc
26-
- unnamedResult
27-
settings:
28-
hugeParam:
29-
sizeThreshold: 512
30-
rangeValCopy:
31-
sizeThreshold: 512
32-
gocyclo:
33-
min-complexity: 15
34-
goimports:
35-
local-prefixes: github.com/k8snetworkplumbingwg/sriov-cni
36-
gomnd:
37-
settings:
38-
mnd:
39-
# don't include the "operation" and "assign"
40-
checks: argument,case,condition,return
41-
lll:
42-
line-length: 140
43-
misspell:
44-
locale: US
45-
prealloc:
46-
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
47-
# True by default.
48-
simple: true
49-
range-loops: true # Report preallocation suggestions on range loops, true by default
50-
for-loops: false # Report preallocation suggestions on for loops, false by default
4+
run:
5+
timeout: 10m
516

527
linters:
53-
# please, do not use `enable-all`: it's deprecated and will be removed soon.
54-
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
55-
disable-all: true
8+
default: none
569
enable:
10+
- asciicheck # checks for non-ASCII identifiers
11+
- bidichk # checks for dangerous unicode sequences (security)
5712
- bodyclose
13+
- copyloopvar
14+
- depguard
5815
- dogsled
5916
- dupl
6017
- errcheck
61-
- copyloopvar
18+
- errname # checks error naming conventions
6219
- exhaustive
63-
# - funlen
20+
- gocheckcompilerdirectives # validates go compiler directives
6421
- goconst
6522
- gocritic
66-
# - gocyclo
67-
- gofmt
68-
- goimports
69-
# - mnd
7023
- goprintffuncname
7124
- gosec
72-
- gosimple
25+
- staticcheck
7326
- govet
7427
- ineffassign
75-
# - lll
28+
- makezero # finds slice declarations with non-zero initial length
7629
- misspell
7730
- nakedret
7831
- prealloc
79-
- rowserrcheck
80-
- staticcheck
81-
- stylecheck
82-
- typecheck
32+
- reassign # checks package variable reassignment
8333
- unconvert
8434
- unparam
8535
- unused
8636
- whitespace
8737

88-
issues:
89-
# Excluding configuration per-path, per-linter, per-text and per-source
90-
exclude-rules:
91-
- path: _test\.go
92-
linters:
93-
- gomnd
94-
- gosec
95-
- dupl
96-
- lll
97-
- stylecheck
98-
- goconst
99-
exclude-dirs:
100-
- .github/
101-
- docs/
102-
- images/
38+
settings:
39+
depguard:
40+
rules:
41+
main:
42+
deny:
43+
- pkg: github.com/sirupsen/logrus
44+
desc: "logging is allowed only by logutils.Log"
45+
dupl:
46+
threshold: 100
47+
funlen:
48+
lines: 100
49+
statements: 50
50+
goconst:
51+
min-len: 2
52+
min-occurrences: 2
53+
gocritic:
54+
enabled-tags:
55+
- diagnostic
56+
- experimental
57+
- opinionated
58+
- performance
59+
- style
60+
disabled-checks:
61+
- ifElseChain
62+
- whyNoLint
63+
- unnamedResult
64+
settings:
65+
hugeParam:
66+
sizeThreshold: 512
67+
rangeValCopy:
68+
sizeThreshold: 512
69+
gocyclo:
70+
min-complexity: 15
71+
mnd:
72+
checks:
73+
- argument
74+
- case
75+
- condition
76+
- return
77+
lll:
78+
line-length: 140
79+
misspell:
80+
locale: US
81+
prealloc:
82+
simple: true
83+
range-loops: true
84+
for-loops: false
85+
staticcheck:
86+
checks:
87+
- all
88+
- -QF1001
89+
- -QF1003
90+
- -QF1008
91+
dot-import-whitelist:
92+
- github.com/onsi/ginkgo/v2
93+
- github.com/onsi/gomega
94+
- github.com/onsi/gomega/gstruct
95+
96+
exclusions:
97+
generated: lax
98+
presets:
99+
- comments
100+
- std-error-handling
101+
paths:
102+
- vendor/
103+
- .github/
104+
- docs/
105+
- images/
106+
rules:
107+
- path: _test\.go
108+
linters:
109+
- mnd
110+
- gosec
111+
- dupl
112+
- lll
113+
- goconst
114+
115+
formatters:
116+
enable:
117+
- gofmt
118+
- goimports
119+
settings:
120+
goimports:
121+
local-prefixes:
122+
- github.com/k8snetworkplumbingwg/sriov-cni

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ build: | $(BUILDDIR) ; $(info Building $(BINARY_NAME)...) @ ## Build SR-IOV CNI
5454

5555
# Tools
5656
GOLANGCI_LINT = $(BINDIR)/golangci-lint
57-
GOLANGCI_LINT_VERSION = v1.64.7
57+
GOLANGCI_LINT_VERSION = v2.7.2
5858
$(GOLANGCI_LINT): | $(BINDIR) ; $(info Installing golangci-lint...)
59-
$Q GOBIN=$(BINDIR) $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
59+
$Q GOBIN=$(BINDIR) $(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
6060

6161
# Tools
6262
MOCKERY = $(BINDIR)/mockery

go.mod

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module github.com/k8snetworkplumbingwg/sriov-cni
22

3-
go 1.24.2
3+
go 1.25.3
44

55
require (
66
github.com/containernetworking/cni v1.3.0
7-
github.com/containernetworking/plugins v1.8.1-0.20251002142623-372953dfb89f
7+
github.com/containernetworking/plugins v1.9.0
88
github.com/k8snetworkplumbingwg/cni-log v0.0.0-20230801160229-b6e062c9e0f2
9-
github.com/onsi/ginkgo/v2 v2.27.2
10-
github.com/onsi/gomega v1.38.2
9+
github.com/onsi/ginkgo/v2 v2.27.3
10+
github.com/onsi/gomega v1.38.3
1111
github.com/stretchr/testify v1.11.1
1212
github.com/vishvananda/netlink v1.3.1
13-
golang.org/x/net v0.47.0
14-
golang.org/x/sys v0.38.0
13+
golang.org/x/net v0.48.0
14+
golang.org/x/sys v0.39.0
1515
)
1616

1717
require (
@@ -28,10 +28,10 @@ require (
2828
github.com/stretchr/objx v0.5.2 // indirect
2929
github.com/vishvananda/netns v0.0.5 // indirect
3030
go.yaml.in/yaml/v3 v3.0.4 // indirect
31-
golang.org/x/mod v0.29.0 // indirect
32-
golang.org/x/sync v0.18.0 // indirect
33-
golang.org/x/text v0.31.0 // indirect
34-
golang.org/x/tools v0.38.0 // indirect
31+
golang.org/x/mod v0.30.0 // indirect
32+
golang.org/x/sync v0.19.0 // indirect
33+
golang.org/x/text v0.32.0 // indirect
34+
golang.org/x/tools v0.39.0 // indirect
3535
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
3636
gopkg.in/yaml.v2 v2.4.0 // indirect
3737
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1
44
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
55
github.com/containernetworking/cni v1.3.0 h1:v6EpN8RznAZj9765HhXQrtXgX+ECGebEYEmnuFjskwo=
66
github.com/containernetworking/cni v1.3.0/go.mod h1:Bs8glZjjFfGPHMw6hQu82RUgEPNGEaBb9KS5KtNMnJ4=
7-
github.com/containernetworking/plugins v1.8.1-0.20251002142623-372953dfb89f h1:+2jbLXdXfgb3Yn8xpmjAiwK7SskgT9zx376q3T6VF7c=
8-
github.com/containernetworking/plugins v1.8.1-0.20251002142623-372953dfb89f/go.mod h1:JG3BxoJifxxHBhG3hFyxyhid7JgRVBu/wtooGEvWf1c=
7+
github.com/containernetworking/plugins v1.9.0 h1:Mg3SXBdRGkdXyFC4lcwr6u2ZB2SDeL6LC3U+QrEANuQ=
8+
github.com/containernetworking/plugins v1.9.0/go.mod h1:JG3BxoJifxxHBhG3hFyxyhid7JgRVBu/wtooGEvWf1c=
99
github.com/coreos/go-iptables v0.8.0 h1:MPc2P89IhuVpLI7ETL/2tx3XZ61VeICZjYqDEgNsPRc=
1010
github.com/coreos/go-iptables v0.8.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
1111
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -40,10 +40,10 @@ github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
4040
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
4141
github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
4242
github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
43-
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
44-
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
45-
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
46-
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
43+
github.com/onsi/ginkgo/v2 v2.27.3 h1:ICsZJ8JoYafeXFFlFAG75a7CxMsJHwgKwtO+82SE9L8=
44+
github.com/onsi/ginkgo/v2 v2.27.3/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
45+
github.com/onsi/gomega v1.38.3 h1:eTX+W6dobAYfFeGC2PV6RwXRu/MyT+cQguijutvkpSM=
46+
github.com/onsi/gomega v1.38.3/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
4747
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
4848
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
4949
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -70,20 +70,20 @@ github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zd
7070
github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
7171
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
7272
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
73-
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
74-
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
75-
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
76-
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
77-
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
78-
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
73+
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
74+
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
75+
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
76+
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
77+
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
78+
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
7979
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8080
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
81-
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
82-
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
83-
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
84-
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
85-
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
86-
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
81+
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
82+
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
83+
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
84+
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
85+
golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
86+
golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=
8787
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
8888
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
8989
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

0 commit comments

Comments
 (0)