diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6ce75734..1bcc643c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ on: env: CGO_ENABLED: 0 - GO_VERSION: '1.21' + GO_VERSION: '1.23' REGISTRY: ghcr.io # github.repository as / IMAGE_NAME: ${{ github.repository }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b4be25ac..b4669f93 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,7 +7,7 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - GO_VERSION: '1.21' + GO_VERSION: '1.23' jobs: manager-image: diff --git a/.golangci.yml b/.golangci.yml index 77008864..cfe4df8b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,7 +13,7 @@ linters: - errorlint - exhaustive # - exhaustivestruct - - exportloopref + - copyloopvar - forbidigo - forcetypeassert - funlen diff --git a/Dockerfile b/Dockerfile index 8e19c009..85f5209f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Build the manager binary -ARG GOVER=1.21 +ARG GOVER=1.23 FROM golang:${GOVER} as builder WORKDIR /workspace diff --git a/Makefile b/Makefile index 04233abd..579bc4ea 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ GO_INSTALL = ./scripts/go_install.sh # Binaries. CONTROLLER_GEN := go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14 -GOLANGCI_LINT_VER := v1.59.1 +GOLANGCI_LINT_VER := v1.61.0 GOLANGCI_LINT_BIN := golangci-lint GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER) @@ -107,7 +107,7 @@ endif # Build time versioning details. LDFLAGS := $(shell hack/version.sh) -GOLANG_VERSION := 1.21 +GOLANG_VERSION := 1.23 ## -------------------------------------- ## Help diff --git a/controller/machine/hardware.go b/controller/machine/hardware.go index 9dc21dec..3b340b21 100644 --- a/controller/machine/hardware.go +++ b/controller/machine/hardware.go @@ -251,8 +251,6 @@ func byHardwareAffinity(hardware []tinkv1.Hardware, preferred []infrastructurev1 scores := map[client.ObjectKey]int32{} // compute scores for each item based on the preferred term weights for _, term := range preferred { - term := term - selector, err := metav1.LabelSelectorAsSelector(&term.HardwareAffinityTerm.LabelSelector) if err != nil { return nil, fmt.Errorf("constructing label selector: %w", err) diff --git a/controller/machine/scope_test.go b/controller/machine/scope_test.go index 98106cf7..7cfb9fb8 100644 --- a/controller/machine/scope_test.go +++ b/controller/machine/scope_test.go @@ -84,8 +84,6 @@ func Test_Machine(t *testing.T) { } for name, c := range cases { - name, c := name, c - t.Run(name, func(t *testing.T) { t.Parallel() g := NewWithT(t) diff --git a/controller/machine/template_test.go b/controller/machine/template_test.go index 6acb42a8..9345a7d7 100644 --- a/controller/machine/template_test.go +++ b/controller/machine/template_test.go @@ -76,8 +76,6 @@ func Test_Cloud_config_template(t *testing.T) { } for name, c := range cases { - c := c - t.Run(name, func(t *testing.T) { t.Parallel() g := NewWithT(t) diff --git a/controller/machine/tinkerbellmachine_test.go b/controller/machine/tinkerbellmachine_test.go index 0bb17de5..bc2d7670 100644 --- a/controller/machine/tinkerbellmachine_test.go +++ b/controller/machine/tinkerbellmachine_test.go @@ -458,7 +458,7 @@ func Test_Machine_reconciliation_with_available_hardware(t *testing.T) { g.Expect(client.Get(ctx, hardwareNamespacedName, updatedHardware)).To(Succeed()) if diff := cmp.Diff(updatedHardware.Spec.Interfaces[0].Netboot.AllowPXE, ptr.To(true)); diff != "" { - t.Errorf(diff) + t.Error(diff) } }) } @@ -593,7 +593,7 @@ func Test_Machine_reconciliation_workflow_complete(t *testing.T) { g.Expect(client.Get(ctx, hardwareNamespacedName, updatedHardware)).To(Succeed()) if diff := cmp.Diff(updatedHardware.Spec.Interfaces[0].Netboot.AllowPXE, ptr.To(false)); diff != "" { - t.Errorf(diff) + t.Error(diff) } }) } diff --git a/go.mod b/go.mod index 048199da..a1a99746 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/tinkerbell/cluster-api-provider-tinkerbell -go 1.21.0 +go 1.23.0 -toolchain go1.21.2 +toolchain go1.23.1 require ( github.com/go-logr/logr v1.4.1