mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-29 05:22:37 +00:00
Don't change GOPATH or PATH in a script lib
This commit is contained in:
parent
f72484df88
commit
4a5e554704
@ -435,12 +435,19 @@ kube::util::ensure_godep_version() {
|
||||
|
||||
kube::log::status "Installing godep version ${GODEP_VERSION}"
|
||||
go install ./vendor/github.com/tools/godep/
|
||||
GP="$(echo $GOPATH | cut -f1 -d:)"
|
||||
hash -r # force bash to clear PATH cache
|
||||
PATH="${GP}/bin:${PATH}"
|
||||
if ! which godep >/dev/null 2>&1; then
|
||||
kube::log::error "Can't find godep - is your GOPATH 'bin' in your PATH?"
|
||||
kube::log::error " GOPATH: ${GOPATH}"
|
||||
kube::log::error " PATH: ${PATH}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ "$(godep version 2>/dev/null)" != *"godep ${GODEP_VERSION}"* ]]; then
|
||||
kube::log::error "Expected godep ${GODEP_VERSION}, got $(godep version)"
|
||||
kube::log::error "Wrong godep version - is your GOPATH 'bin' in your PATH?"
|
||||
kube::log::error " expected: godep ${GODEP_VERSION}"
|
||||
kube::log::error " got: $(godep version)"
|
||||
kube::log::error " GOPATH: ${GOPATH}"
|
||||
kube::log::error " PATH: ${PATH}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user