mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 11:12:03 +00:00
Use ensured godep instead of relying on PATH
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user