Skip to content

Commit

Permalink
adds ability to skip go mod download
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxesn committed May 13, 2024
1 parent a59d340 commit 3a8de5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ DOCKER_USE_ID_FOR_LINUX=$(shell if [ "$$(uname -s)" = "Linux" ] && [ -n "$${USER
GO_MOD_CACHE=$(shell source $(BUILD_LIB)/common.sh && build::common::use_go_version $(GOLANG_VERSION) > /dev/null 2>&1 && go env GOMODCACHE)
GO_BUILD_CACHE=$(shell source $(BUILD_LIB)/common.sh && build::common::use_go_version $(GOLANG_VERSION) > /dev/null 2>&1 && go env GOCACHE)
CGO_TARGET?=
GO_MODS_VENDORED?=false
######################

#### BUILD FLAGS ####
Expand Down Expand Up @@ -520,7 +521,7 @@ $(GIT_PATCH_TARGET): $(GIT_CHECKOUT_TARGET)
$(REPO)/%ks-distro-go-mod-download: REPO_SUBPATH=$(if $(filter e,$*),,$(*:%/e=%))
$(REPO)/%ks-distro-go-mod-download: $(if $(PATCHES_DIR),$(GIT_PATCH_TARGET),$(GIT_CHECKOUT_TARGET))
@echo -e $(call TARGET_START_LOG)
$(BASE_DIRECTORY)/build/lib/go_mod_download.sh $(MAKE_ROOT) $(REPO) $(GIT_TAG) $(GOLANG_VERSION) "$(REPO_SUBPATH)"
if [[ "$(GO_MODS_VENDORED)" == "false" ]]; then $(BASE_DIRECTORY)/build/lib/go_mod_download.sh $(MAKE_ROOT) $(REPO) $(GIT_TAG) $(GOLANG_VERSION) "$(REPO_SUBPATH)"; fi
@touch $@
@echo -e $(call TARGET_END_LOG)

Expand Down
5 changes: 5 additions & 0 deletions projects/kubernetes/cloud-provider-aws/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ BASE_IMAGE=$(GO_RUNNER_IMAGE)
HAS_RELEASE_BRANCHES=true
HAS_S3_ARTIFACTS=true

# 1-28 and 1-29 includes patches that add the vendor directory
# as well as one that modifies content inside the vendor directory
# set to true to avoid downloading deps overwriting this change/patch
RELEASE_BRANCHS_WITH_VENDORED=1-28 1-29
GO_MODS_VENDORED=$(if $(filter $(RELEASE_BRANCH),$(RELEASE_BRANCHS_WITH_VENDORED)),true,false)
EXTRA_GO_LDFLAGS=-X k8s.io/component-base/version.gitVersion=$(GIT_TAG)

IMAGE_NAMES=cloud-controller-manager
Expand Down

0 comments on commit 3a8de5d

Please sign in to comment.