mirror of https://github.com/k3s-io/k3s
Use ensured godep instead of relying on PATH
parent
c0c62821d7
commit
35cdbdf16c
|
@ -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"
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -51,7 +51,6 @@ function cleanup {
|
|||
echo "Removing ${_tmpdir}"
|
||||
rm -rf "${_tmpdir}"
|
||||
fi
|
||||
export GODEP=""
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
|
|
Loading…
Reference in New Issue