diff --git a/Common.mk b/Common.mk index e2a15ac8c1..7cc2796500 100644 --- a/Common.mk +++ b/Common.mk @@ -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 #### @@ -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) diff --git a/projects/kubernetes/cloud-provider-aws/Makefile b/projects/kubernetes/cloud-provider-aws/Makefile index 21ee14c43a..f7f2c11e17 100644 --- a/projects/kubernetes/cloud-provider-aws/Makefile +++ b/projects/kubernetes/cloud-provider-aws/Makefile @@ -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