diff --git a/hack/godep-restore.sh b/hack/godep-restore.sh index 02b7dbb55e..b427cdc3b0 100755 --- a/hack/godep-restore.sh +++ b/hack/godep-restore.sh @@ -31,5 +31,5 @@ fi kube::util::ensure_godep_version kube::log::status "Downloading dependencies - this might take a while" -GOPATH="${GOPATH}:${KUBE_ROOT}/staging" godep restore "$@" +GOPATH="${GOPATH}:${KUBE_ROOT}/staging" ${KUBE_GODEP:?} restore "$@" kube::log::status "Done" diff --git a/hack/godep-save.sh b/hack/godep-save.sh index 414929750f..257a609cd3 100755 --- a/hack/godep-save.sh +++ b/hack/godep-save.sh @@ -71,7 +71,7 @@ kube::log::status "Running godep save - this might take a while" # This uses $(pwd) rather than ${KUBE_ROOT} because KUBE_ROOT will be # realpath'ed, and godep barfs ("... is not using a known version control # system") on our staging dirs. -GOPATH="${GOPATH}:$(pwd)/staging" godep save "${REQUIRED_BINS[@]}" +GOPATH="${GOPATH}:$(pwd)/staging" ${KUBE_GODEP:?} save "${REQUIRED_BINS[@]}" # create a symlink in vendor directory pointing to the staging client. This # let other packages use the staging client as if it were vendored. diff --git a/hack/lib/util.sh b/hack/lib/util.sh index e5172b550a..ccecdcfa88 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -454,13 +454,7 @@ kube::util::ensure_godep_version() { return fi - # If GODEP is in the path, then use it. - if [[ "$(godep version 2>/dev/null)" == *"godep ${godep_target_version}"* ]]; then - export KUBE_GODEP="$(which godep)" - kube::log::status "Using ${KUBE_GODEP}" - return - fi - + # Otherwise, install forked godep kube::log::status "Installing godep version ${godep_target_version}" # Run in hermetic GOPATH kube::golang::setup_env @@ -468,6 +462,7 @@ kube::util::ensure_godep_version() { export KUBE_GODEP="${KUBE_GOPATH}/bin/godep" kube::log::status "Installed ${KUBE_GODEP}" + # Verify that the installed godep from fork is what we expect if [[ "$(${KUBE_GODEP:?} version 2>/dev/null)" != *"godep ${godep_target_version}"* ]]; then kube::log::error "Expected godep ${godep_target_version} from ${KUBE_GODEP}, got $(${KUBE_GODEP:?} version)" return 1 diff --git a/hack/update-staging-godeps-dockerized.sh b/hack/update-staging-godeps-dockerized.sh index a0e0e50c37..6268465ebf 100755 --- a/hack/update-staging-godeps-dockerized.sh +++ b/hack/update-staging-godeps-dockerized.sh @@ -70,7 +70,7 @@ function updateGodepManifest() { pushd "${TMP_GOPATH}/src/k8s.io/${repo}" >/dev/null kube::log::status "Updating godeps for k8s.io/${repo}" rm -rf Godeps # remove the current Godeps.json so we always rebuild it - GOPATH="${TMP_GOPATH}:${GOPATH}:${GOPATH}/src/k8s.io/kubernetes/staging" godep save ${GODEP_OPTS} ./... 2>&1 | sed 's/^/ /' + GOPATH="${TMP_GOPATH}:${GOPATH}:${GOPATH}/src/k8s.io/kubernetes/staging" ${KUBE_GODEP:?} save ${GODEP_OPTS} ./... 2>&1 | sed 's/^/ /' # Rewriting Godeps.json to cross-out commits that don't really exist because we haven't pushed the prereqs yet local repo diff --git a/hack/verify-godeps.sh b/hack/verify-godeps.sh index a7f46f99a7..ae3b7fd4d9 100755 --- a/hack/verify-godeps.sh +++ b/hack/verify-godeps.sh @@ -51,7 +51,6 @@ function cleanup { echo "Removing ${_tmpdir}" rm -rf "${_tmpdir}" fi - export GODEP="" } trap cleanup EXIT