From b2e6451f70dc09fea7b5cb73ab32e43df12b1b48 Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Thu, 5 Jan 2023 12:06:41 +0530 Subject: [PATCH] go get explicit versions to avoid ambiguous imports --- artifacts/scripts/util.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/artifacts/scripts/util.sh b/artifacts/scripts/util.sh index d6342aa45..dae5c40a1 100755 --- a/artifacts/scripts/util.sh +++ b/artifacts/scripts/util.sh @@ -831,6 +831,7 @@ update-deps-in-gomod() { [ -s go.sum ] && rm go.sum GO111MODULE=on GOPRIVATE="${dep_packages}" GOPROXY=https://proxy.golang.org go mod download + fixAmbiguousImports GOPROXY="file://${GOPATH}/pkg/mod/cache/download,https://proxy.golang.org" GO111MODULE=on GOPRIVATE="${dep_packages}" go mod tidy git add go.mod go.sum @@ -853,6 +854,13 @@ update-deps-in-gomod() { ensure-clean-working-dir } +function fixAmbiguousImports() { + # ref: https://github.com/kubernetes/publishing-bot/issues/304 + # TODO(nikhita): remove this when k/k drops or bumps + # cloud.google.com/go to a version > v0.105.0 + go get cloud.google.com/go/compute/metadata@v0.2.0 +} + gomod-pseudo-version() { TZ=GMT git show -q --pretty='format:v0.0.0-%cd-%h' --date='format-local:%Y%m%d%H%M%S' --abbrev=12 }