Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix: changes to release process #4813

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to be consistent with upstream CAPI (i.e. when it builds clusterctl) and it also us having to use the git config command.

-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)

Expand Down
2 changes: 1 addition & 1 deletion cloudbuild-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down