Skip to content

Commit 99e2530

Browse files
chore: update go version to 1.24 (Mellanox#1549)
2 parents c71775c + d52fd69 commit 99e2530

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/Mellanox/maintenance-operator/api v0.2.2

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
@@ -100,6 +100,13 @@ const (
100100
defaultDriversInventoryPath = "/mnt/drivers-inventory"
101101
)
102102

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

808815
if cr.Spec.OFEDDriver.LivenessProbe == nil {
809816
cr.Spec.OFEDDriver.LivenessProbe = &mellanoxv1alpha1.PodProbeSpec{
810-
InitialDelaySeconds: 30,
811-
PeriodSeconds: 30,
817+
InitialDelaySeconds: initialDelayStartupProbeSeconds,
818+
PeriodSeconds: defaultPeriodSeconds,
812819
}
813820
}
814821

815822
if cr.Spec.OFEDDriver.ReadinessProbe == nil {
816823
cr.Spec.OFEDDriver.ReadinessProbe = &mellanoxv1alpha1.PodProbeSpec{
817-
InitialDelaySeconds: 10,
818-
PeriodSeconds: 30,
824+
InitialDelaySeconds: defaultInitialDelaySeconds,
825+
PeriodSeconds: defaultPeriodSeconds,
819826
}
820827
}
821828
}

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)