Skip to content

Commit 81e0fd7

Browse files
k8s-ci-robotLiangquanLi930
authored andcommitted
Merge pull request #5577 from mdbooth/issue-5576
🌱 Reduce memory consumption of cluster-api-provider-aws-build-docker
2 parents faf2fdc + 8841520 commit 81e0fd7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ LDFLAGS := $(shell source ./hack/version.sh; version::ldflags)
143143
# Set USE_EXISTING_CLUSTER to use an existing kubernetes context
144144
USE_EXISTING_CLUSTER ?= "false"
145145

146+
# GORELEASER_PARALLELISM restricts the number of tasks goreleaser will run
147+
# concurrently. The primary reason to do this is to ensure its memory usage
148+
# remains within the resource limits of the
149+
# cluster-api-provider-aws-build-docker job
150+
GORELEASER_PARALLELISM ?= 2
151+
146152
# Set E2E_SKIP_EKS_UPGRADE to false to test EKS upgrades.
147153
# Warning, this takes a long time
148154
E2E_SKIP_EKS_UPGRADE ?= "false"
@@ -571,7 +577,7 @@ release: clean-release check-release-tag check-release-branch $(RELEASE_DIR) $(G
571577
$(MAKE) release-changelog
572578
CORE_CONTROLLER_IMG=$(PROD_REGISTRY)/$(CORE_IMAGE_NAME) $(MAKE) release-manifests
573579
$(MAKE) release-policies
574-
$(GORELEASER) release --config $(GORELEASER_CONFIG) --release-notes $(RELEASE_DIR)/CHANGELOG.md --clean
580+
$(GORELEASER) release --config $(GORELEASER_CONFIG) --release-notes $(RELEASE_DIR)/CHANGELOG.md --clean --parallelism $(GORELEASER_PARALLELISM)
575581

576582
release-policies: $(RELEASE_POLICIES) ## Release policies
577583

@@ -606,7 +612,7 @@ promote-images: $(KPROMO) $(YQ)
606612

607613
.PHONY: release-binaries
608614
release-binaries: $(GORELEASER) ## Builds only the binaries, not a release.
609-
GOMAXPROCS=2 $(GORELEASER) build --config $(GORELEASER_CONFIG) --snapshot --clean
615+
$(GORELEASER) build --config $(GORELEASER_CONFIG) --snapshot --clean --parallelism $(GORELEASER_PARALLELISM)
610616

611617
.PHONY: release-staging
612618
release-staging: ## Builds and push container images and manifests to the staging bucket.

pkg/cloud/services/ssm/secret_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func TestServiceCreate(t *testing.T) {
178178
expectedPrefix: "/prefix",
179179
wantErr: true,
180180
expect: func(m *mock_ssmiface.MockSSMAPIMockRecorder) {
181-
m.PutParameter(context.TODO(), gomock.AssignableToTypeOf(&ssm.PutParameterInput{})).Return(nil, &mockAPIError{
181+
m.PutParameter(context.TODO(), gomock.AssignableToTypeOf(&ssm.PutParameterInput{})).MinTimes(1).Return(nil, &mockAPIError{
182182
"ParameterAlreadyExists",
183183
"parameter already exists"}).Do(
184184
func(ctx context.Context, putParameterInput *ssm.PutParameterInput, optFns ...func(*ssm.Options)) {
@@ -211,7 +211,7 @@ func TestServiceCreate(t *testing.T) {
211211
secretPrefix: "",
212212
expectedPrefix: "/cluster.x-k8s.io",
213213
expect: func(m *mock_ssmiface.MockSSMAPIMockRecorder) {
214-
m.PutParameter(context.TODO(), gomock.AssignableToTypeOf(&ssm.PutParameterInput{})).Return(nil, &mockAPIError{
214+
m.PutParameter(context.TODO(), gomock.AssignableToTypeOf(&ssm.PutParameterInput{})).MinTimes(1).Return(nil, &mockAPIError{
215215
"ParameterLimitExceeded",
216216
"parameter limit exceeded"})
217217
},

0 commit comments

Comments
 (0)