Skip to content

Commit ff200f9

Browse files
authored
Merge pull request #1814 from mythi/PR-2024-020
build: use Go 1.23.0
2 parents 404508a + 7e5b280 commit ff200f9

26 files changed

+34
-29
lines changed

Diff for: .github/workflows/lib-validate.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: golangci-lint
4343
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6
4444
with:
45-
version: v1.57.2
45+
version: v1.60.3
4646
args: -v --timeout 5m
4747
build:
4848
name: Build and check device plugins

Diff for: .golangci.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ linters:
1212
- bodyclose
1313
- dogsled
1414
- errcheck
15-
- exportloopref
15+
- copyloopvar
1616
- gocognit
1717
- goconst
1818
- gocyclo
1919
- godot
20-
- goerr113
20+
- err113
2121
- gofmt
2222
- goimports
2323
- gomodguard
@@ -62,6 +62,9 @@ linters-settings:
6262

6363
issues:
6464
exclude-rules:
65+
- linters:
66+
- gosec
67+
text: "G115"
6568
- path: _test\.go
6669
linters:
6770
- gocognit

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ EXTRA_BUILD_ARGS ?= ""
1010

1111
CERT_MANAGER_VERSION ?= v1.15.2
1212
CONTROLLER_GEN_VERSION ?= v0.16.1
13-
GOLANGCI_LINT_VERSION ?= v1.57.2
13+
GOLANGCI_LINT_VERSION ?= v1.60.3
1414
KIND_VERSION ?= v0.23.0
1515
GOLICENSES_VERSION ?= v1.6.0
1616
# Default bundle image tag
@@ -176,7 +176,7 @@ e2e-spr:
176176

177177
pre-pull:
178178
ifeq ($(TAG),devel)
179-
@$(BUILDER) pull golang:1.22-bookworm
179+
@$(BUILDER) pull golang:1.23-bookworm
180180
@$(BUILDER) pull debian:unstable-slim
181181
@$(BUILDER) pull ubuntu:22.04
182182
endif

Diff for: build/docker/intel-deviceplugin-operator.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-dlb-initcontainer.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3333
##
3434
## This is used on release branches before tagging a stable version.
3535
## The main branch defaults to using the latest Golang base image.
36-
ARG GOLANG_BASE=golang:1.22-bookworm
36+
ARG GOLANG_BASE=golang:1.23-bookworm
3737
###
3838
FROM ${GOLANG_BASE} as builder
3939
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-dlb-plugin.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-dsa-plugin.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-fpga-admissionwebhook.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-fpga-initcontainer.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3333
##
3434
## This is used on release branches before tagging a stable version.
3535
## The main branch defaults to using the latest Golang base image.
36-
ARG GOLANG_BASE=golang:1.22-bookworm
36+
ARG GOLANG_BASE=golang:1.23-bookworm
3737
###
3838
FROM ${GOLANG_BASE} as builder
3939
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-fpga-plugin.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-gpu-fakedev.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-gpu-initcontainer.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3333
##
3434
## This is used on release branches before tagging a stable version.
3535
## The main branch defaults to using the latest Golang base image.
36-
ARG GOLANG_BASE=golang:1.22-bookworm
36+
ARG GOLANG_BASE=golang:1.23-bookworm
3737
###
3838
FROM ${GOLANG_BASE} as builder
3939
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-gpu-plugin.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-iaa-plugin.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-qat-initcontainer.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3333
##
3434
## This is used on release branches before tagging a stable version.
3535
## The main branch defaults to using the latest Golang base image.
36-
ARG GOLANG_BASE=golang:1.22-bookworm
36+
ARG GOLANG_BASE=golang:1.23-bookworm
3737
###
3838
FROM ${GOLANG_BASE} as builder
3939
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-qat-plugin-kerneldrv.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3333
##
3434
## This is used on release branches before tagging a stable version.
3535
## The main branch defaults to using the latest Golang base image.
36-
ARG GOLANG_BASE=golang:1.22-bookworm
36+
ARG GOLANG_BASE=golang:1.23-bookworm
3737
###
3838
FROM ${GOLANG_BASE} as builder
3939
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-qat-plugin.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-sgx-admissionwebhook.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-sgx-initcontainer.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3333
##
3434
## This is used on release branches before tagging a stable version.
3535
## The main branch defaults to using the latest Golang base image.
36-
ARG GOLANG_BASE=golang:1.22-bookworm
36+
ARG GOLANG_BASE=golang:1.23-bookworm
3737
###
3838
FROM ${GOLANG_BASE} as builder
3939
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-sgx-plugin.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/intel-xpumanager-sidecar.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
3434
##
3535
## This is used on release branches before tagging a stable version.
3636
## The main branch defaults to using the latest Golang base image.
37-
ARG GOLANG_BASE=golang:1.22-bookworm
37+
ARG GOLANG_BASE=golang:1.23-bookworm
3838
###
3939
FROM ${GOLANG_BASE} as builder
4040
ARG DIR=/intel-device-plugins-for-kubernetes

Diff for: build/docker/lib/golang_base.docker

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
##
66
## This is used on release branches before tagging a stable version.
77
## The main branch defaults to using the latest Golang base image.
8-
ARG GOLANG_BASE=golang:1.22-bookworm
8+
ARG GOLANG_BASE=golang:1.23-bookworm
99
###

Diff for: cmd/gpu_plugin/gpu_plugin_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ func createBypathTestFiles(t *testing.T, card, root, linkFile string, bypathFile
589589
t.Fatal("Couldn't create test drm dir", err)
590590
}
591591

592-
if err := os.WriteFile(devPath, []byte{0}, os.ModePerm); err != nil {
592+
if err := os.WriteFile(devPath, []byte{0}, 0o600); err != nil {
593593
t.Fatal("Couldn't create card file", err)
594594
}
595595

@@ -604,7 +604,7 @@ func createBypathTestFiles(t *testing.T, card, root, linkFile string, bypathFile
604604
}
605605

606606
for _, f := range bypathFiles {
607-
if err := os.WriteFile(path.Join(byPath, f), []byte{1}, os.ModePerm); err != nil {
607+
if err := os.WriteFile(path.Join(byPath, f), []byte{1}, 0o600); err != nil {
608608
t.Fatal("WriteFile failed:", path.Join(byPath, f))
609609
}
610610
}

Diff for: cmd/internal/labeler/labeler_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ func TestLabeling(t *testing.T) {
638638
t.Fatalf("can't create temporary subroot directory: %+v", err)
639639
}
640640

641-
tc := tc
642641
t.Run(tc.name, func(t *testing.T) {
643642
err := os.MkdirAll(path.Join(subroot, "0"), 0750)
644643
if err != nil {

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/intel/intel-device-plugins-for-kubernetes
22

3-
go 1.22.0
3+
go 1.23.0
44

55
require (
66
github.com/fsnotify/fsnotify v1.7.0

Diff for: pkg/idxd/plugin_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ func getFakeDevNodes(devDir, charDevDir, wqName string) ([]pluginapi.DeviceSpec,
3939

4040
var devNum, queueNum int
4141

42-
fmt.Sscanf(wqName, "wq%d.%d", &devNum, &queueNum)
42+
if _, err := fmt.Sscanf(wqName, "wq%d.%d", &devNum, &queueNum); err != nil {
43+
return []pluginapi.DeviceSpec{}, err
44+
}
45+
4346
charDevPath := path.Join(charDevDir, fmt.Sprintf("%d:%d", dsaMajor, devNum*10+queueNum))
4447

4548
return []pluginapi.DeviceSpec{

0 commit comments

Comments
 (0)