From f7872a1b448c8717e7d8de7e9de0f7a9dfe31f67 Mon Sep 17 00:00:00 2001 From: Furkat Gofurov Date: Fri, 25 Oct 2024 12:13:00 +0300 Subject: [PATCH 1/3] Bump go version to v1.22.x Signed-off-by: Furkat Gofurov --- .devcontainer/devcontainer.json | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/e2e-test.yml | 2 +- .github/workflows/e2e.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 4 ++-- .golangci.yml | 2 +- Makefile | 2 +- go.mod | 2 +- hack/tools/go.mod | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b081dea3..65bdabfb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ // Features to add to the dev container. More info: https://containers.dev/features. "features": { "ghcr.io/devcontainers/features/go:1": { - "version": "1.21" + "version": "1.22" }, "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/mpriscella/features/kind:1": {}, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3db90776..fcb711e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.22' check-latest: true cache: true - name: Verify diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 2d8cc506..071cd567 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -31,7 +31,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Build e2e image run: make e2e-image - uses: actions/cache@v4.1.1 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 6bfbd723..f892af88 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -34,7 +34,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Setup kind uses: helm/kind-action@v1.10.0 with: diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 718d174b..62453191 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.21.8 + go-version: 1.22.8 - name: golangci-lint uses: golangci/golangci-lint-action@v6.1.1 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d9129d71..ae6ece29 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,6 +15,6 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.21.8 + go-version: 1.22.8 - name: Lint run: make lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 748eb3ee..062994f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: setupGo uses: actions/setup-go@v5 with: - go-version: '=1.21.8' + go-version: '=1.22.8' - name: Docker login ghcr.io uses: docker/login-action@v3 with: @@ -62,7 +62,7 @@ jobs: - name: setupGo uses: actions/setup-go@v5 with: - go-version: '=1.21.8' + go-version: '=1.22.8' - name: Update manifests run: | make release RELEASE_TAG=${{ env.TAG }} REGISTRY=${{ env.GHCR_REGISTRY }} diff --git a/.golangci.yml b/.golangci.yml index 8c44044d..9e4d5851 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ # Options for analysis running. run: - go: "1.21" + go: "1.22" skip-files: - "zz_generated.*\\.go$" - "conversion\\.go" diff --git a/Makefile b/Makefile index 92cdffa3..68a79df7 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ SHELL = /usr/bin/env bash -o pipefail # # Go. # -GO_VERSION ?= 1.22.0 +GO_VERSION ?= 1.22.8 GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION) # Use GOPROXY environment variable if set diff --git a/go.mod b/go.mod index 7f83cc42..7fbdde88 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/rancher/cluster-api-provider-rke2 -go 1.21 +go 1.22 require ( github.com/blang/semver/v4 v4.0.0 diff --git a/hack/tools/go.mod b/hack/tools/go.mod index ba36803a..f13fc94c 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -1,6 +1,6 @@ module github.com/rancher/cluster-api-provider-rke2/hack/tools -go 1.22.6 +go 1.22.8 require sigs.k8s.io/cluster-api/hack/tools v0.0.0-20240820112706-3abe3058a6a8 From 717ab55b18c8f77791e7b0b1104abcc1c19759e1 Mon Sep 17 00:00:00 2001 From: Furkat Gofurov Date: Fri, 25 Oct 2024 12:17:58 +0300 Subject: [PATCH 2/3] Support arm64/amd64 only archs for image building Signed-off-by: Furkat Gofurov --- Makefile | 4 ++-- examples/docker/air-gapped/image-building/files/install.sh | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 68a79df7..9ddbc278 100644 --- a/Makefile +++ b/Makefile @@ -113,8 +113,8 @@ GH := $(abspath $(TOOLS_BIN_DIR)/$(GH_BIN)) # Registry / images TAG ?= dev ARCH ?= $(shell go env GOARCH) -ALL_ARCH = amd64 arm arm64 ppc64le s390x -TARGET_PLATFORMS := linux/amd64,linux/arm64,linux/arm,linux/ppc64le,linux/s390x +ALL_ARCH = amd64 arm64 +TARGET_PLATFORMS := linux/amd64,linux/arm64 MACHINE := cluster-api-provider-rke2 REGISTRY ?= ghcr.io ORG ?= rancher diff --git a/examples/docker/air-gapped/image-building/files/install.sh b/examples/docker/air-gapped/image-building/files/install.sh index dcd046d0..5f02911d 100644 --- a/examples/docker/air-gapped/image-building/files/install.sh +++ b/examples/docker/air-gapped/image-building/files/install.sh @@ -165,10 +165,6 @@ setup_arch() { ARCH=amd64 SUFFIX=$(uname -s | tr '[:upper:]' '[:lower:]')-${ARCH} ;; - s390x) - ARCH=s390x - SUFFIX=$(uname -s | tr '[:upper:]' '[:lower:]')-${ARCH} - ;; *) fatal "unsupported architecture ${ARCH}" ;; From e200841da84fb3c841910fc88df159374a4cca04 Mon Sep 17 00:00:00 2001 From: Furkat Gofurov Date: Fri, 25 Oct 2024 12:26:04 +0300 Subject: [PATCH 3/3] remove redundant steps in docker build Signed-off-by: Furkat Gofurov --- Dockerfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index c930dffc..bc7517f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,15 +16,6 @@ ARG goproxy=https://proxy.golang.org # Run this with docker build --build-arg package=./controlplane or --build-arg package=./bootstrap ENV GOPROXY=$goproxy -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum - -# Cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN --mount=type=cache,target=/go/pkg/mod \ - go mod download - # Copy the sources COPY ./ ./