When installing vendored godep, ensure that it's in path

This commit is contained in:
Christoph Blecker 2018-01-30 09:30:36 -08:00
parent 78ed389122
commit d58afe6384
No known key found for this signature in database
GPG Key ID: B34A59A9D39F838B
2 changed files with 6 additions and 0 deletions

View File

@ -446,6 +446,9 @@ 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 [[ "$(godep version 2>/dev/null)" != *"godep ${GODEP_VERSION}"* ]]; then
kube::log::error "Expected godep ${GODEP_VERSION}, got $(godep version)"

View File

@ -29,6 +29,9 @@ if ! [[ ${KUBE_FORCE_VERIFY_CHECKS:-} =~ ^[yY]$ ]] && \
exit 0
fi
# Ensure we have the right godep version available
kube::util::ensure_godep_version
if [[ -z ${TMP_GOPATH:-} ]]; then
# Create a nice clean place to put our new godeps
_tmpdir="$(mktemp -d -t gopath.XXXXXX)"