Merge pull request #46193 from cblecker/staging-godeps-dockerized

Automatic merge from submit-queue (batch tested with PRs 43443, 46193, 49071, 47252)

Run the update-staging-godeps script inside a docker container

**What this PR does / why we need it**:
This PR moves the update-staging-godeps script to run inside a docker container.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @ixdy @sttts
This commit is contained in:
Kubernetes Submit Queue
2017-07-25 21:52:48 -07:00
committed by GitHub
11 changed files with 162 additions and 100 deletions

View File

@@ -496,7 +496,7 @@ kube::util::ensure_clean_working_dir() {
# Ensure that the given godep version is installed and in the path
kube::util::ensure_godep_version() {
GODEP_VERSION=${1:-"v79"}
if [[ "$(godep version)" == *"godep ${GODEP_VERSION}"* ]]; then
if [[ "$(godep version 2>/dev/null)" == *"godep ${GODEP_VERSION}"* ]]; then
return
fi
@@ -505,7 +505,7 @@ kube::util::ensure_godep_version() {
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 "${GODEP_VERSION}"
git checkout -q "${GODEP_VERSION}"
GOPATH="${KUBE_TEMP}/go" go install .
popd >/dev/null
@@ -825,6 +825,18 @@ function kube::util::ensure-cfssl {
popd > /dev/null
}
# kube::util::ensure_dockerized
# Confirms that the script is being run inside a kube-build image
#
function kube::util::ensure_dockerized {
if [[ -f /kube-build-image ]]; then
return 0
else
echo "ERROR: This script is designed to be run inside a kube-build container"
exit 1
fi
}
# Some useful colors.
if [[ -z "${color_start-}" ]]; then
declare -r color_start="\033["