Merge pull request #42309 from cblecker/godep-race

Automatic merge from submit-queue (batch tested with PRs 42128, 42064, 42253, 42309, 42322)

Fix godep race in local builds

**What this PR does / why we need it**:
This fixes a small race condition when building a godep version other than the latest. As you're building godep once, and then building it again after checkout, this can cause inconsistency in the version selected for use. This fix tells the first `go get` to only download and not build. Then we build manually after checking out the target version.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-03-02 05:00:54 -08:00 committed by GitHub
commit e9d34a692d

View File

@ -470,7 +470,7 @@ kube::util::ensure_godep_version() {
kube::util::ensure-temp-dir
mkdir -p "${KUBE_TEMP}/go/src"
GOPATH="${KUBE_TEMP}/go" go get -u github.com/tools/godep 2>/dev/null
GOPATH="${KUBE_TEMP}/go" go get -d -u github.com/tools/godep 2>/dev/null
pushd "${KUBE_TEMP}/go/src/github.com/tools/godep" >/dev/null
git checkout "${1:-v74}"
GOPATH="${KUBE_TEMP}/go" go install .