From 3fc97b0c98e8a346ab8e44aa21644d1594e64522 Mon Sep 17 00:00:00 2001 From: Tesshu Flower Date: Sun, 14 Jun 2026 21:30:48 -0400 Subject: [PATCH] :seedling: chore: upgrade to go 1.26 (#1571) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: upgrade to go 1.26 Upgrades Go version from 1.25 to 1.26. Changes: - go.mod — go directive updated to 1.26.0 - .github/workflows/*.yml — GO_VERSION updated to 1.26 (5 workflows) - build/Dockerfile.* — base image updated to golang:1.26-bookworm (5 Dockerfiles) - pkg/placement/controllers/scheduling/scheduling_controller.go — fix pre-existing printf format mismatch (%q -> %d for int args) surfaced by stricter Go 1.26 linter Relates to: https://github.com/open-cluster-management-io/ocm/issues/1555 Signed-off-by: Tesshu Flower * fix: pin engineerd/setup-kind to working commit SHA Pin engineerd/setup-kind to commit SHA ecfad61750951586a9ef973db567df1d28671bdc which is the tip of the v0.6.2 branch and includes the required dist/ build artifact. The v0.6.2 tag currently resolves to a different commit that is missing dist/main/index.js, causing e2e CI to fail. Signed-off-by: Tesshu Flower --------- Signed-off-by: Tesshu Flower --- .github/workflows/cloudevents-integration.yml | 2 +- .github/workflows/e2e.yml | 10 +++++----- .github/workflows/post.yml | 2 +- .github/workflows/pre.yml | 2 +- .github/workflows/releaseimage.yml | 2 +- build/Dockerfile.addon | 2 +- build/Dockerfile.placement | 2 +- build/Dockerfile.registration | 2 +- build/Dockerfile.registration-operator | 2 +- build/Dockerfile.work | 2 +- go.mod | 2 +- .../controllers/scheduling/scheduling_controller.go | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cloudevents-integration.yml b/.github/workflows/cloudevents-integration.yml index 38951c85e..ee82ce330 100644 --- a/.github/workflows/cloudevents-integration.yml +++ b/.github/workflows/cloudevents-integration.yml @@ -14,7 +14,7 @@ on: - release-* env: - GO_VERSION: '1.25' + GO_VERSION: '1.26' GO_REQUIRED_MIN_VERSION: '' permissions: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0bc191d31..28980c04e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -15,7 +15,7 @@ on: - release-* env: - GO_VERSION: '1.25' + GO_VERSION: '1.26' GO_REQUIRED_MIN_VERSION: '' USE_EXISTING_CLUSTER: false # set to true to use an existing kind cluster for debugging with act @@ -36,7 +36,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - name: Setup kind - uses: engineerd/setup-kind@v0.6.2 + uses: engineerd/setup-kind@ecfad61750951586a9ef973db567df1d28671bdc # v0.6.2 with: version: v0.22.0 skipClusterCreation: ${{ env.USE_EXISTING_CLUSTER }} @@ -63,7 +63,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - name: Setup kind - uses: engineerd/setup-kind@v0.6.2 + uses: engineerd/setup-kind@ecfad61750951586a9ef973db567df1d28671bdc # v0.6.2 with: version: v0.22.0 skipClusterCreation: ${{ env.USE_EXISTING_CLUSTER }} @@ -90,7 +90,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - name: Setup kind - uses: engineerd/setup-kind@v0.6.2 + uses: engineerd/setup-kind@ecfad61750951586a9ef973db567df1d28671bdc # v0.6.2 with: version: v0.22.0 skipClusterCreation: ${{ env.USE_EXISTING_CLUSTER }} @@ -117,7 +117,7 @@ jobs: with: go-version: ${{ env.GO_VERSION }} - name: Setup kind - uses: engineerd/setup-kind@v0.6.2 + uses: engineerd/setup-kind@ecfad61750951586a9ef973db567df1d28671bdc # v0.6.2 with: version: v0.22.0 skipClusterCreation: ${{ env.USE_EXISTING_CLUSTER }} diff --git a/.github/workflows/post.yml b/.github/workflows/post.yml index 0764981ef..c5e4bca08 100644 --- a/.github/workflows/post.yml +++ b/.github/workflows/post.yml @@ -13,7 +13,7 @@ on: env: # Common versions - GO_VERSION: '1.25' + GO_VERSION: '1.26' GO_REQUIRED_MIN_VERSION: '' permissions: diff --git a/.github/workflows/pre.yml b/.github/workflows/pre.yml index 954087afa..ec0e853a6 100644 --- a/.github/workflows/pre.yml +++ b/.github/workflows/pre.yml @@ -13,7 +13,7 @@ on: - release-* env: - GO_VERSION: '1.25' + GO_VERSION: '1.26' GO_REQUIRED_MIN_VERSION: '' permissions: diff --git a/.github/workflows/releaseimage.yml b/.github/workflows/releaseimage.yml index fb6da0468..f26701629 100644 --- a/.github/workflows/releaseimage.yml +++ b/.github/workflows/releaseimage.yml @@ -6,7 +6,7 @@ on: - 'v*.*.*' env: # Common versions - GO_VERSION: '1.25' + GO_VERSION: '1.26' GO_REQUIRED_MIN_VERSION: '' GOPATH: '/home/runner/work/ocm/ocm/go' GITHUB_REF: ${{ github.ref }} diff --git a/build/Dockerfile.addon b/build/Dockerfile.addon index 38fb739e6..9c2841663 100644 --- a/build/Dockerfile.addon +++ b/build/Dockerfile.addon @@ -1,4 +1,4 @@ -FROM golang:1.25-bookworm AS builder +FROM golang:1.26-bookworm AS builder ARG OS=linux ARG ARCH=amd64 WORKDIR /go/src/open-cluster-management.io/ocm diff --git a/build/Dockerfile.placement b/build/Dockerfile.placement index 429a3b264..535d1a782 100644 --- a/build/Dockerfile.placement +++ b/build/Dockerfile.placement @@ -1,4 +1,4 @@ -FROM golang:1.25-bookworm AS builder +FROM golang:1.26-bookworm AS builder ARG OS=linux ARG ARCH=amd64 WORKDIR /go/src/open-cluster-management.io/ocm diff --git a/build/Dockerfile.registration b/build/Dockerfile.registration index f821bf48f..03ee1e1fa 100644 --- a/build/Dockerfile.registration +++ b/build/Dockerfile.registration @@ -1,4 +1,4 @@ -FROM golang:1.25-bookworm AS builder +FROM golang:1.26-bookworm AS builder ARG OS=linux ARG ARCH=amd64 WORKDIR /go/src/open-cluster-management.io/ocm diff --git a/build/Dockerfile.registration-operator b/build/Dockerfile.registration-operator index 4615a80eb..dbf1d79dd 100644 --- a/build/Dockerfile.registration-operator +++ b/build/Dockerfile.registration-operator @@ -1,4 +1,4 @@ -FROM golang:1.25-bookworm AS builder +FROM golang:1.26-bookworm AS builder ARG OS=linux ARG ARCH=amd64 WORKDIR /go/src/open-cluster-management.io/ocm diff --git a/build/Dockerfile.work b/build/Dockerfile.work index 7efbcb626..f6d1fcd36 100644 --- a/build/Dockerfile.work +++ b/build/Dockerfile.work @@ -1,4 +1,4 @@ -FROM golang:1.25-bookworm AS builder +FROM golang:1.26-bookworm AS builder ARG OS=linux ARG ARCH=amd64 WORKDIR /go/src/open-cluster-management.io/ocm diff --git a/go.mod b/go.mod index 7b66ad584..1d2a560e5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module open-cluster-management.io/ocm -go 1.25.0 +go 1.26.0 require ( github.com/aws/aws-sdk-go-v2 v1.41.11 diff --git a/pkg/placement/controllers/scheduling/scheduling_controller.go b/pkg/placement/controllers/scheduling/scheduling_controller.go index 2a7b16b7f..c97421421 100644 --- a/pkg/placement/controllers/scheduling/scheduling_controller.go +++ b/pkg/placement/controllers/scheduling/scheduling_controller.go @@ -591,7 +591,7 @@ func (c *schedulingController) createOrUpdatePlacementDecision( clusterDecisions := placementDecision.Status.Decisions if len(clusterDecisions) > maxNumOfClusterDecisions { - return fmt.Errorf("the number of clusterdecisions %q exceeds the max limitation %q", len(clusterDecisions), maxNumOfClusterDecisions) + return fmt.Errorf("the number of clusterdecisions %d exceeds the max limitation %d", len(clusterDecisions), maxNumOfClusterDecisions) } existPlacementDecision, err := c.placementDecisionLister.PlacementDecisions(placementDecision.Namespace).Get(placementDecisionName)