Skip to content

Commit d52fd69

Browse files
committed
chore: update go version to 1.24
Signed-off-by: Fred Rolland <[email protected]>
1 parent e1140d2 commit d52fd69

File tree

7 files changed

+28
-24
lines changed

7 files changed

+28
-24
lines changed

.github/workflows/checks.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Set up Go 1.x
1212
uses: actions/setup-go@v5
1313
with:
14-
go-version: '1.23'
14+
go-version: '1.24.x'
1515
- name: checkout
1616
uses: actions/checkout@v4
1717
- name: lint
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set up Go 1.x
4646
uses: actions/setup-go@v5
4747
with:
48-
go-version: '1.23'
48+
go-version: '1.24.x'
4949
- name: checkout
5050
uses: actions/checkout@v4
5151
- name: check manifests
@@ -59,7 +59,7 @@ jobs:
5959
- name: Set up Go 1.x
6060
uses: actions/setup-go@v5
6161
with:
62-
go-version: '1.23'
62+
go-version: '1.24.x'
6363
- name: checkout
6464
uses: actions/checkout@v4
6565
- name: check go modules
@@ -73,7 +73,7 @@ jobs:
7373
- name: Set up Go 1.x
7474
uses: actions/setup-go@v5
7575
with:
76-
go-version: '1.23'
76+
go-version: '1.24.x'
7777
- name: checkout
7878
uses: actions/checkout@v4
7979
- name: check release-build
@@ -87,7 +87,7 @@ jobs:
8787
- name: Set up Go 1.x
8888
uses: actions/setup-go@v5
8989
with:
90-
go-version: '1.23'
90+
go-version: '1.24.x'
9191
- name: checkout
9292
uses: actions/checkout@v4
9393
- name: test

.golangci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ linters-settings:
2727
local-prefixes: github.com/Mellanox/network-operator
2828
golint:
2929
min-confidence: 0
30-
gomnd:
30+
mnd:
3131
settings:
32-
mnd:
33-
# don't include the "operation" and "assign"
34-
checks: argument,case,condition,return
32+
# don't include the "operation" and "assign"
33+
checks: argument,case,condition,return
3534
govet:
36-
check-shadowing: true
3735
settings:
3836
printf:
3937
funcs:
@@ -61,15 +59,15 @@ linters:
6159
- dogsled
6260
- dupl
6361
- errcheck
64-
- exportloopref
62+
- copyloopvar
6563
- funlen
6664
#- gochecknoinits
6765
#- goconst
6866
- gocritic
6967
- gocognit
7068
- gofmt
7169
- goimports
72-
- gomnd
70+
- mnd
7371
- goprintffuncname
7472
- gosec
7573
- gosimple
@@ -104,11 +102,12 @@ issues:
104102
text: "should not use dot imports"
105103
- path: _test\.go
106104
linters:
107-
- gomnd
105+
- mnd
108106
- goconst
107+
- typecheck
109108
- text: "Magic number: 1"
110109
linters:
111-
- gomnd
110+
- mnd
112111
# controller-gen generates zz_generated.deepcopy.go that doesn't comply with some golangci-lint checks
113112
- path: api/v1alpha1/zz_generated.deepcopy.go
114113
linters:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ GO = go
126126
# golangci-lint is used to lint go code.
127127
GOLANGCI_LINT_PKG=github.com/golangci/golangci-lint/cmd/golangci-lint
128128
GOLANGCI_LINT_BIN= golangci-lint
129-
GOLANGCI_LINT_VER = v1.61.0
129+
GOLANGCI_LINT_VER = v1.64.8
130130
GOLANGCI_LINT = $(TOOLSDIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
131131
$(GOLANGCI_LINT):
132132
$(call go-install-tool,$(GOLANGCI_LINT_PKG),$(GOLANGCI_LINT_BIN),$(GOLANGCI_LINT_VER))

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/Mellanox/network-operator
22

3-
go 1.23.3
3+
go 1.24
44

55
require (
66
github.com/Masterminds/semver/v3 v3.3.1

pkg/nodeinfo/node_info.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ func (p *provider) GetNodePools(filters ...Filter) []NodePool {
7474
nodePoolMap := make(map[string]NodePool)
7575

7676
for _, node := range filtered {
77-
node := node
7877
nodeLabels := node.GetLabels()
7978

8079
nodePool := NodePool{}

pkg/state/state_ofed.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ const (
101101
defaultDriversInventoryPath = "/mnt/drivers-inventory"
102102
)
103103

104+
const (
105+
defaultInitialDelaySeconds = 10
106+
defaultPeriodSeconds = 30
107+
startupProbePeriodSeconds = 10
108+
initialDelayStartupProbeSeconds = 30
109+
)
110+
104111
// CertConfigPathMap indicates standard OS specific paths for ssl keys/certificates.
105112
// Where Go looks for certs: https://golang.org/src/crypto/x509/root_linux.go
106113
// Where OCP mounts proxy certs on RHCOS nodes:
@@ -804,22 +811,22 @@ func (e envVarsWithGet) Get(name string) *v1.EnvVar {
804811
func setProbesDefaults(cr *mellanoxv1alpha1.NicClusterPolicy) {
805812
if cr.Spec.OFEDDriver.StartupProbe == nil {
806813
cr.Spec.OFEDDriver.StartupProbe = &mellanoxv1alpha1.PodProbeSpec{
807-
InitialDelaySeconds: 10,
808-
PeriodSeconds: 10,
814+
InitialDelaySeconds: defaultInitialDelaySeconds,
815+
PeriodSeconds: startupProbePeriodSeconds,
809816
}
810817
}
811818

812819
if cr.Spec.OFEDDriver.LivenessProbe == nil {
813820
cr.Spec.OFEDDriver.LivenessProbe = &mellanoxv1alpha1.PodProbeSpec{
814-
InitialDelaySeconds: 30,
815-
PeriodSeconds: 30,
821+
InitialDelaySeconds: initialDelayStartupProbeSeconds,
822+
PeriodSeconds: defaultPeriodSeconds,
816823
}
817824
}
818825

819826
if cr.Spec.OFEDDriver.ReadinessProbe == nil {
820827
cr.Spec.OFEDDriver.ReadinessProbe = &mellanoxv1alpha1.PodProbeSpec{
821-
InitialDelaySeconds: 10,
822-
PeriodSeconds: 30,
828+
InitialDelaySeconds: defaultInitialDelaySeconds,
829+
PeriodSeconds: defaultPeriodSeconds,
823830
}
824831
}
825832
}

pkg/state/state_skel.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ func (s *stateSkel) deleteStateRelatedObjects(ctx context.Context, stateObjectsT
347347
return false, err
348348
}
349349
for _, obj := range l.Items {
350-
obj := obj
351350
if stateObjectsToKeep.Exist(gvk, types.NamespacedName{
352351
Name: obj.GetName(),
353352
Namespace: obj.GetNamespace()}) {

0 commit comments

Comments
 (0)