From c06d1ff980dd9fbcd648870c9e1557da2eac3d3b Mon Sep 17 00:00:00 2001 From: Richard Case Date: Fri, 23 Feb 2024 14:08:18 +0000 Subject: [PATCH] fix: changes to release process Signed-off-by: Richard Case --- Makefile | 11 +++++------ cloudbuild-nightly.yaml | 2 +- cloudbuild.yaml | 2 +- go.mod | 2 ++ hack/tools/go.mod | 2 ++ 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 070b0970a1..5893da5e96 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ include $(ROOT_DIR_RELATIVE)/common.mk # Go GO_VERSION ?=1.21.5 -GO_CONTAINER_IMAGE ?= public.ecr.aws/docker/library/golang:$(GO_VERSION) +GO_CONTAINER_IMAGE ?= golang:$(GO_VERSION) # Directories. ARTIFACTS ?= $(REPO_ROOT)/_artifacts @@ -607,18 +607,17 @@ release-binaries: ## Builds the binaries to publish with a release RELEASE_BINARY=./cmd/clusterawsadm GOOS=windows GOARCH=arm64 EXT=.exe $(MAKE) release-binary .PHONY: release-binary -release-binary: $(RELEASE_DIR) versions.mk build-toolchain ## Release binary +release-binary: $(RELEASE_DIR) versions.mk ## Release binary docker run \ --rm \ -e CGO_ENABLED=0 \ -e GOOS=$(GOOS) \ -e GOARCH=$(GOARCH) \ - --mount=source=gocache,target=/go/pkg/mod \ - --mount=source=gocache,target=/root/.cache/go-build \ + -e GOCACHE=/tmp/ \ + --user $$(id -u):$$(id -g) \ -v "$$(pwd):/workspace$(DOCKER_VOL_OPTS)" \ -w /workspace \ - $(TOOLCHAIN_IMAGE) \ - git config --global --add safe.directory /workspace; \ + $(GO_CONTAINER_IMAGE) \ go build -ldflags '$(LDFLAGS) -extldflags "-static"' \ -o $(RELEASE_DIR)/$(notdir $(RELEASE_BINARY))-$(GOOS)-$(GOARCH)$(EXT) $(RELEASE_BINARY) diff --git a/cloudbuild-nightly.yaml b/cloudbuild-nightly.yaml index 3979d51979..d46ac1edfc 100644 --- a/cloudbuild-nightly.yaml +++ b/cloudbuild-nightly.yaml @@ -3,7 +3,7 @@ timeout: 3000s options: substitution_option: ALLOW_LOOSE steps: - - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e' + - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240210-29014a6e3a' entrypoint: make env: - DOCKER_CLI_EXPERIMENTAL=enabled diff --git a/cloudbuild.yaml b/cloudbuild.yaml index f8a71c1b0c..182ca60d03 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -3,7 +3,7 @@ timeout: 3000s options: substitution_option: ALLOW_LOOSE steps: - - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e' + - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240210-29014a6e3a' entrypoint: make env: - DOCKER_CLI_EXPERIMENTAL=enabled diff --git a/go.mod b/go.mod index 046be3cb9f..37afa39707 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module sigs.k8s.io/cluster-api-provider-aws/v2 go 1.21 +toolchain go1.21.5 + replace ( // kube-openapi should match the version imported by CAPI. k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 diff --git a/hack/tools/go.mod b/hack/tools/go.mod index 8d65b0a1ce..05fc77a216 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -2,6 +2,8 @@ module sigs.k8s.io/cluster-api-provider-aws/hack/tools go 1.21 +toolchain go1.21.5 + // kube-openapi should match the version imported by kustomize. replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f