Skip to content

build: use Go 1.23.0 #1814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lib-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6
with:
version: v1.57.2
version: v1.60.3
args: -v --timeout 5m
build:
name: Build and check device plugins
Expand Down
7 changes: 5 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ linters:
- bodyclose
- dogsled
- errcheck
- exportloopref
- copyloopvar
- gocognit
- goconst
- gocyclo
- godot
- goerr113
- err113
- gofmt
- goimports
- gomodguard
Expand Down Expand Up @@ -62,6 +62,9 @@ linters-settings:

issues:
exclude-rules:
- linters:
- gosec
text: "G115"
- path: _test\.go
linters:
- gocognit
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EXTRA_BUILD_ARGS ?= ""

CERT_MANAGER_VERSION ?= v1.15.2
CONTROLLER_GEN_VERSION ?= v0.16.1
GOLANGCI_LINT_VERSION ?= v1.57.2
GOLANGCI_LINT_VERSION ?= v1.60.3
KIND_VERSION ?= v0.23.0
GOLICENSES_VERSION ?= v1.6.0
# Default bundle image tag
Expand Down Expand Up @@ -176,7 +176,7 @@ e2e-spr:

pre-pull:
ifeq ($(TAG),devel)
@$(BUILDER) pull golang:1.22-bookworm
@$(BUILDER) pull golang:1.23-bookworm
@$(BUILDER) pull debian:unstable-slim
@$(BUILDER) pull ubuntu:22.04
endif
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-deviceplugin-operator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-dlb-initcontainer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-dlb-plugin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-dsa-plugin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-fpga-admissionwebhook.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-fpga-initcontainer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-fpga-plugin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-gpu-fakedev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-gpu-initcontainer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-gpu-plugin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-iaa-plugin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-qat-initcontainer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-qat-plugin-kerneldrv.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-qat-plugin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-sgx-admissionwebhook.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-sgx-initcontainer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-sgx-plugin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/intel-xpumanager-sidecar.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG FINAL_BASE=registry.access.redhat.com/ubi9-micro:latest
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
FROM ${GOLANG_BASE} as builder
ARG DIR=/intel-device-plugins-for-kubernetes
Expand Down
2 changes: 1 addition & 1 deletion build/docker/lib/golang_base.docker
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
##
## This is used on release branches before tagging a stable version.
## The main branch defaults to using the latest Golang base image.
ARG GOLANG_BASE=golang:1.22-bookworm
ARG GOLANG_BASE=golang:1.23-bookworm
###
4 changes: 2 additions & 2 deletions cmd/gpu_plugin/gpu_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func createBypathTestFiles(t *testing.T, card, root, linkFile string, bypathFile
t.Fatal("Couldn't create test drm dir", err)
}

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

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

for _, f := range bypathFiles {
if err := os.WriteFile(path.Join(byPath, f), []byte{1}, os.ModePerm); err != nil {
if err := os.WriteFile(path.Join(byPath, f), []byte{1}, 0o600); err != nil {
t.Fatal("WriteFile failed:", path.Join(byPath, f))
}
}
Expand Down
1 change: 0 additions & 1 deletion cmd/internal/labeler/labeler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ func TestLabeling(t *testing.T) {
t.Fatalf("can't create temporary subroot directory: %+v", err)
}

tc := tc
t.Run(tc.name, func(t *testing.T) {
err := os.MkdirAll(path.Join(subroot, "0"), 0750)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/intel/intel-device-plugins-for-kubernetes

go 1.22.0
go 1.23.0

require (
github.com/fsnotify/fsnotify v1.7.0
Expand Down
5 changes: 4 additions & 1 deletion pkg/idxd/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ func getFakeDevNodes(devDir, charDevDir, wqName string) ([]pluginapi.DeviceSpec,

var devNum, queueNum int

fmt.Sscanf(wqName, "wq%d.%d", &devNum, &queueNum)
if _, err := fmt.Sscanf(wqName, "wq%d.%d", &devNum, &queueNum); err != nil {
return []pluginapi.DeviceSpec{}, err
}

charDevPath := path.Join(charDevDir, fmt.Sprintf("%d:%d", dsaMajor, devNum*10+queueNum))

return []pluginapi.DeviceSpec{
Expand Down
Loading