Merge pull request #29947 from ixdy/go-bindata-cross-image

Automatic merge from submit-queue

Install go-bindata in cross-build image

Another follow-up to #25584.

We need `go-bindata` to create `test/e2e/generated`, and downloading it with `go get` at build time is painful for a variety of reasons. We can just include it in the cross-build image and not worry about it, especially as it updates very infrequently.

This fixes `hack/update-generated-protobuf.sh` as well.

cc @jayunit100 @soltysh
pull/6/head
Kubernetes Submit Queue 2016-08-04 06:03:29 -07:00 committed by GitHub
commit 3e5b40d9a5
7 changed files with 12 additions and 20 deletions

View File

@ -62,11 +62,11 @@ RUN echo "deb http://emdebian.org/tools/debian/ jessie main" > /etc/apt/sources.
# work around 64MB tmpfs size in Docker 1.6
ENV TMPDIR /tmp.k8s
# Get the code coverage tool and godep
# Get the code coverage tool, godep, and go-bindata
RUN mkdir $TMPDIR \
&& chmod a+rwx $TMPDIR \
&& chmod o+t $TMPDIR \
&& go get golang.org/x/tools/cmd/cover github.com/tools/godep
&& go get golang.org/x/tools/cmd/cover github.com/tools/godep github.com/jteeuwen/go-bindata/go-bindata
# Download and symlink etcd. We need this for our integration tests.
RUN export ETCD_VERSION=v2.2.1; \

View File

@ -1 +1 @@
v1.6.3-0
v1.6.3-1

View File

@ -45,7 +45,7 @@ readonly KUBE_GCS_DELETE_EXISTING="${KUBE_GCS_DELETE_EXISTING:-n}"
# Constants
readonly KUBE_BUILD_IMAGE_REPO=kube-build
readonly KUBE_BUILD_IMAGE_CROSS_TAG="v1.6.3-0"
readonly KUBE_BUILD_IMAGE_CROSS_TAG="v1.6.3-1"
# KUBE_BUILD_DATA_CONTAINER_NAME=kube-build-data-<hash>"
# Here we map the output directories across both the local and remote _output

View File

@ -34,6 +34,7 @@ retry() {
export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}
retry go get github.com/tools/godep && godep version
retry go get github.com/jteeuwen/go-bindata/go-bindata
retry go get github.com/jstemmer/go-junit-report
# Enable the Go race detector.

View File

@ -32,6 +32,7 @@ retry() {
export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}
retry go get github.com/tools/godep && godep version
retry go get github.com/jteeuwen/go-bindata/go-bindata
export LOG_LEVEL=4

View File

@ -19,7 +19,7 @@ set -o pipefail
set -o nounset
if [[ -z "${KUBE_ROOT:-}" ]]; then
echo "KUBE_ROOT not detected, setting default."
# Relative to test/e2e/generated/
KUBE_ROOT="../../../"
fi
@ -28,25 +28,14 @@ if [[ ! -d "${KUBE_ROOT}/examples" ]]; then
exit 1
fi
# Setup bindata if not already in the system.
# For separation of concerns, download first, then install later.
if ! git config -l | grep -q "user.name" && ! git config -l | grep -q "user.email" ; then
git config --global user.name bindata-mockuser
git config --global user.email bindata-mockuser@example.com
fi
go get -u github.com/jteeuwen/go-bindata/... || echo "go-bindata get failed, possibly already exists, proceeding"
go install github.com/jteeuwen/go-bindata/... || echo "go-bindata install may have failed, proceeding anyway..."
if [[ ! -f ${GOPATH}/bin/go-bindata ]]; then
echo "missing bin/go-bindata"
echo "for debugging, printing search for bindata files out..."
find ${GOPATH} -name go-bindata
if ! which go-bindata &>/dev/null ; then
echo "Cannot find go-bindata. Install with"
echo " go get -u github.com/jteeuwen/go-bindata/go-bindata"
exit 5
fi
BINDATA_OUTPUT="${KUBE_ROOT}/test/e2e/generated/bindata.go"
${GOPATH}/bin/go-bindata -nometadata -prefix "${KUBE_ROOT}" -o ${BINDATA_OUTPUT} -pkg generated \
go-bindata -nometadata -prefix "${KUBE_ROOT}" -o ${BINDATA_OUTPUT} -pkg generated \
-ignore .jpg -ignore .png -ignore .md \
"${KUBE_ROOT}/examples/..." \
"${KUBE_ROOT}/docs/user-guide/..." \

View File

@ -28,6 +28,7 @@ set -x
. $1
go get -u github.com/jteeuwen/go-bindata/go-bindata
make generated_files
# TODO converge build steps with hack/build-go some day if possible.