From 1155c1746e07a4ab1d167cb327e7220141aee9f2 Mon Sep 17 00:00:00 2001 From: arshadda Date: Fri, 7 Nov 2025 19:17:24 +0530 Subject: [PATCH 1/3] Bump go version --- Makefile | 2 +- Tiltfile | 6 +++--- netlify.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 42057a31593f..204691259ba1 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ SHELL:=/usr/bin/env bash # # Go. # -GO_VERSION ?= 1.23.12 +GO_VERSION ?= 1.24.10 GO_DIRECTIVE_VERSION ?= 1.22.0 GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION) diff --git a/Tiltfile b/Tiltfile index 353d05cf9e09..163dc957ac88 100644 --- a/Tiltfile +++ b/Tiltfile @@ -184,9 +184,9 @@ def load_provider_tiltfiles(): tilt_helper_dockerfile_header = """ # Tilt image -FROM golang:1.23.12 as tilt-helper +FROM golang:1.24.10 as tilt-helper # Install delve. Note this should be kept in step with the Go release minor version. -RUN go install github.com/go-delve/delve/cmd/dlv@v1.22 +RUN go install github.com/go-delve/delve/cmd/dlv@v1.24 # Support live reloading with Tilt RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/master/restart.sh && \ wget --output-document /start.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/master/start.sh && \ @@ -195,7 +195,7 @@ RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com """ tilt_dockerfile_header = """ -FROM golang:1.23.12 as tilt +FROM golang:1.24.10 as tilt WORKDIR / COPY --from=tilt-helper /process.txt . COPY --from=tilt-helper /start.sh . diff --git a/netlify.toml b/netlify.toml index bdf02d48839a..3a5b1ceb3d54 100644 --- a/netlify.toml +++ b/netlify.toml @@ -4,7 +4,7 @@ publish = "docs/book/book" [build.environment] - GO_VERSION = "1.23.12" + GO_VERSION = "1.24.10" # Standard Netlify redirects [[redirects]] From 2b21bbd59878793f73751a8e448077ec32990b99 Mon Sep 17 00:00:00 2001 From: arshadda Date: Fri, 7 Nov 2025 20:41:33 +0530 Subject: [PATCH 2/3] update golint version --- .github/workflows/pr-golangci-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-golangci-lint.yaml b/.github/workflows/pr-golangci-lint.yaml index cce3785b22ab..c7ea42b0a691 100644 --- a/.github/workflows/pr-golangci-lint.yaml +++ b/.github/workflows/pr-golangci-lint.yaml @@ -30,6 +30,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # tag=v6.1.1 with: - version: v1.60.2 + version: v1.64.3 args: --out-format=colored-line-number working-directory: ${{matrix.working-directory}} From db58791902f3c5c98bd66a276851414c4b3e3fa3 Mon Sep 17 00:00:00 2001 From: arshadda Date: Mon, 10 Nov 2025 10:33:49 +0530 Subject: [PATCH 3/3] fix lint issues --- .golangci.yml | 11 +++++++++++ .../controllers/clusterresourceset_helpers.go | 12 ++---------- test/e2e/cluster_upgrade_runtimesdk.go | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 4281784a0b41..d9b2eb35ba4c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -373,3 +373,14 @@ issues: - linters: - govet text: "non-constant format string in call to sigs\\.k8s\\.io\\/cluster-api\\/util\\/conditions\\." + # Ignore ginkgolinter suggestions + - linters: + - ginkgolinter + text: "(wrong error assertion|wrong comparison assertion)" + path: "(^.*_test\\.go$|^test/e2e/.*\\.go$)" + # Ignore intrange suggestions in targeted files only + - linters: + - intrange + text: "for loop can be changed to `i := range machineList`" + path: "(^exp/internal/controllers/machinepool_controller_phases\\.go$|^internal/controllers/machineset/machineset_controller\\.go$)" + \ No newline at end of file diff --git a/exp/addons/internal/controllers/clusterresourceset_helpers.go b/exp/addons/internal/controllers/clusterresourceset_helpers.go index 3c250d482880..8296397530c7 100644 --- a/exp/addons/internal/controllers/clusterresourceset_helpers.go +++ b/exp/addons/internal/controllers/clusterresourceset_helpers.go @@ -147,11 +147,7 @@ func (r *ClusterResourceSetReconciler) getOrCreateClusterResourceSetBinding(ctx // getConfigMap retrieves any ConfigMap from the given name and namespace. func getConfigMap(ctx context.Context, c client.Client, configmapName types.NamespacedName) (*corev1.ConfigMap, error) { configMap := &corev1.ConfigMap{} - configMapKey := client.ObjectKey{ - Namespace: configmapName.Namespace, - Name: configmapName.Name, - } - if err := c.Get(ctx, configMapKey, configMap); err != nil { + if err := c.Get(ctx, configmapName, configMap); err != nil { return nil, err } @@ -161,11 +157,7 @@ func getConfigMap(ctx context.Context, c client.Client, configmapName types.Name // getSecret retrieves any Secret from the given secret name and namespace. func getSecret(ctx context.Context, c client.Client, secretName types.NamespacedName) (*corev1.Secret, error) { secret := &corev1.Secret{} - secretKey := client.ObjectKey{ - Namespace: secretName.Namespace, - Name: secretName.Name, - } - if err := c.Get(ctx, secretKey, secret); err != nil { + if err := c.Get(ctx, secretName, secret); err != nil { return nil, err } diff --git a/test/e2e/cluster_upgrade_runtimesdk.go b/test/e2e/cluster_upgrade_runtimesdk.go index 6467c3b57c3d..736f11d6a295 100644 --- a/test/e2e/cluster_upgrade_runtimesdk.go +++ b/test/e2e/cluster_upgrade_runtimesdk.go @@ -607,7 +607,7 @@ func beforeClusterDeleteHandler(ctx context.Context, c client.Client, cluster ty var blocked = true // If the Cluster is not found it has been deleted and the hook is unblocked. - if apierrors.IsNotFound(c.Get(ctx, client.ObjectKey{Name: cluster.Name, Namespace: cluster.Namespace}, &clusterv1.Cluster{})) { + if apierrors.IsNotFound(c.Get(ctx, cluster, &clusterv1.Cluster{})) { blocked = false } return blocked