Skip to content

Commit

Permalink
Merge pull request kubernetes#57564 from spiffxp/follow-gazelle-repo
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Handle gazelle moving to a new repo

Gazelle moved to a new repo, and out of bazebuild/rules_go.  At first I tried the same approach I used for kubernetes/test-infra and just bumped to the new repo.  Turns out that version was later than what is used here in kubernetes/kubernetes.  Now I'm trying to use a rewritten version of `go_install_from_commit` to support installing packages that aren't available at HEAD

ref kubernetes/test-infra#6075

/priority critical-urgent
https://k8s-testgrid.appspot.com/presubmits-kubernetes-blocking#pull-kubernetes-verify is blocked until this is addressed
  • Loading branch information
Kubernetes Submit Queue authored Dec 22, 2017
2 parents 13c80a9 + e559389 commit 475d5c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hack/lib/util.sh
Original file line number Diff line number Diff line change
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

0 comments on commit 475d5c3

Please sign in to comment.