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

Automated cherry pick of #57564: Rewrite go_install_from_commit to handle pkgs that aren't in #58722

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions hack/lib/util.sh
Expand Up @@ -475,10 +475,15 @@ kube::util::go_install_from_commit() {

kube::util::ensure-temp-dir
mkdir -p "${KUBE_TEMP}/go/src"
GOPATH="${KUBE_TEMP}/go" go get -d -u "${pkg}"
# TODO(spiffxp): remove this brittle workaround for go getting a package that doesn't exist at HEAD
repo=$(echo ${pkg} | cut -d/ -f1-3)
git clone "https://${repo}" "${KUBE_TEMP}/go/src/${repo}"
# GOPATH="${KUBE_TEMP}/go" go get -d -u "${pkg}"
(
cd "${KUBE_TEMP}/go/src/${pkg}"
cd "${KUBE_TEMP}/go/src/${repo}"
git fetch # TODO(spiffxp): workaround
git checkout -q "${commit}"
GOPATH="${KUBE_TEMP}/go" go get -d "${pkg}" #TODO(spiffxp): workaround
GOPATH="${KUBE_TEMP}/go" go install "${pkg}"
)
PATH="${KUBE_TEMP}/go/bin:${PATH}"
Expand Down