From cbf886c7f4235cf93bee4cce4dea3eb719062660 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 13 Apr 2016 23:30:15 -0700 Subject: [PATCH] Convert everything to use vendor/ --- Makefile | 2 - build/common.sh | 17 +++++-- cluster/addons/dns/kube2sky/Makefile | 4 +- .../go2idl/generator/snippet_writer_test.go | 2 +- .../go2idl/go-to-protobuf/protobuf/cmd.go | 2 +- docs/devel/development.md | 2 +- docs/devel/e2e-node-tests.md | 4 +- docs/devel/flaky-tests.md | 2 +- docs/devel/testing.md | 6 +-- examples/https-nginx/Makefile | 2 +- hack/after-build/update-generated-protobuf.sh | 2 +- hack/after-build/verify-description.sh | 2 +- hack/boilerplate/boilerplate.py | 2 +- hack/jenkins/test-dockerized.sh | 2 +- hack/lib/golang.sh | 51 +++++++++---------- hack/lib/util.sh | 6 +-- hack/test-go.sh | 3 +- hack/update-codecgen.sh | 4 +- hack/update-gofmt.sh | 2 +- hack/verify-codecgen.sh | 2 +- hack/verify-codegen.sh | 13 ++--- hack/verify-flags-underscore.py | 4 +- hack/verify-godeps.sh | 2 +- hack/verify-gofmt.sh | 2 +- hack/verify-govet.sh | 4 +- hack/verify-import-boss.sh | 2 - hooks/pre-commit | 2 +- test/e2e_node/jenkins/e2e-node-jenkins.sh | 4 +- test/e2e_node/runner/run_e2e.go | 4 +- test/images/clusterapi-tester/Makefile | 2 +- test/images/n-way-http/Makefile | 2 +- test/images/network-tester/Makefile | 2 +- test/images/resource-consumer/Makefile | 4 +- test/soak/cauldron/Makefile | 2 +- 34 files changed, 84 insertions(+), 84 deletions(-) diff --git a/Makefile b/Makefile index 3dd158d9f9..d0081e2a5c 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ # clean: Clean up. OUT_DIR = _output -GODEPS_PKG_DIR = Godeps/_workspace/pkg KUBE_GOFLAGS = $(GOFLAGS) export KUBE_GOFLAGS @@ -111,7 +110,6 @@ test_e2e_node: clean: build/make-clean.sh rm -rf $(OUT_DIR) - rm -rf $(GODEPS_PKG_DIR) .PHONY: clean # Run 'go vet'. diff --git a/build/common.sh b/build/common.sh index 64fff7f4bb..046b609870 100755 --- a/build/common.sh +++ b/build/common.sh @@ -77,13 +77,10 @@ readonly DOCKER_MOUNT_ARGS_BASE=( --volume /etc/localtime:/etc/localtime:ro ) -# We create a Docker data container to cache incremental build artifacts. We -# need to cache both the go tree in _output and the go tree under Godeps. +# We create a Docker data container to cache incremental build artifacts. readonly REMOTE_OUTPUT_GOPATH="${REMOTE_OUTPUT_SUBPATH}/go" -readonly REMOTE_GODEP_GOPATH="/go/src/${KUBE_GO_PACKAGE}/Godeps/_workspace/pkg" readonly DOCKER_DATA_MOUNT_ARGS=( --volume "${REMOTE_OUTPUT_GOPATH}" - --volume "${REMOTE_GODEP_GOPATH}" ) # This is where the final release artifacts are created locally @@ -465,7 +462,6 @@ function kube::build::source_targets() { docs examples federation - Godeps/_workspace/src Godeps/Godeps.json hack LICENSE @@ -475,6 +471,7 @@ function kube::build::source_targets() { README.md test third_party + vendor contrib/completions/bash/kubectl contrib/mesos .generated_docs @@ -547,6 +544,16 @@ function kube::build::clean_images() { } function kube::build::ensure_data_container() { + # This is temporary, while last remnants of _workspace are obliterated. If + # the data container exists it might be from before the change from + # Godeps/_workspace/ to vendor/, and thereby still have a Godeps/_workspace/ + # directory in it, which trips up godep (yay godep!). Once we are confident + # that this has run ~everywhere we care about, we can remove this. + # TODO(thockin): remove this after v1.3 is cut. + if "${DOCKER[@]}" inspect "${KUBE_BUILD_DATA_CONTAINER_NAME}" \ + | grep -q "Godeps/_workspace/pkg"; then + docker rm -f "${KUBE_BUILD_DATA_CONTAINER_NAME}" + fi if ! "${DOCKER[@]}" inspect "${KUBE_BUILD_DATA_CONTAINER_NAME}" >/dev/null 2>&1; then kube::log::status "Creating data container" local -ra docker_cmd=( diff --git a/cluster/addons/dns/kube2sky/Makefile b/cluster/addons/dns/kube2sky/Makefile index 7e55f518b8..cfb53e33a9 100644 --- a/cluster/addons/dns/kube2sky/Makefile +++ b/cluster/addons/dns/kube2sky/Makefile @@ -46,7 +46,7 @@ all: container kube2sky: kube2sky.go # Only build kube2sky. This requires go and godep in PATH - CGO_ENABLED=0 GOARCH=$(ARCH) GOARM=$(GOARM) godep go build -a -installsuffix cgo --ldflags '-w' ./kube2sky.go + CGO_ENABLED=0 GOARCH=$(ARCH) GOARM=$(GOARM) go build -a -installsuffix cgo --ldflags '-w' ./kube2sky.go container: # Copy the content in this dir to the temp dir @@ -80,7 +80,7 @@ clean: rm -f kube2sky test: clean - godep go test -v --vmodule=*=4 + go test -v --vmodule=*=4 .PHONY: all kube2sky container push clean test diff --git a/cmd/libs/go2idl/generator/snippet_writer_test.go b/cmd/libs/go2idl/generator/snippet_writer_test.go index 19ef83ddd5..3d557c7e56 100644 --- a/cmd/libs/go2idl/generator/snippet_writer_test.go +++ b/cmd/libs/go2idl/generator/snippet_writer_test.go @@ -29,7 +29,7 @@ import ( func construct(t *testing.T, files map[string]string) *generator.Context { b := parser.New() for name, src := range files { - if err := b.AddFile(name, []byte(src)); err != nil { + if err := b.AddFile("/tmp/"+name, name, []byte(src)); err != nil { t.Fatal(err) } } diff --git a/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go b/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go index 579b6f3e9a..3e846d4c38 100644 --- a/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go +++ b/cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go @@ -54,7 +54,7 @@ func New() *Generator { OutputBase: sourceTree, GoHeaderFilePath: filepath.Join(sourceTree, "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt"), } - defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "Godeps", "_workspace", "src", "github.com", "gogo", "protobuf", "protobuf") + defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "vendor", "github.com", "gogo", "protobuf", "protobuf") return &Generator{ Common: common, OutputBase: sourceTree, diff --git a/docs/devel/development.md b/docs/devel/development.md index 415bb49037..d08dc3d2c5 100644 --- a/docs/devel/development.md +++ b/docs/devel/development.md @@ -193,7 +193,7 @@ godep v53 (linux/amd64/go1.5.3) ### Using godep -Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into Godeps/\_workspace. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep). +Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into `vendor/`. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep). 1) Devote a directory to this endeavor: diff --git a/docs/devel/e2e-node-tests.md b/docs/devel/e2e-node-tests.md index 091894578a..9845079619 100644 --- a/docs/devel/e2e-node-tests.md +++ b/docs/devel/e2e-node-tests.md @@ -82,12 +82,12 @@ See [setup_host.sh](../../test/e2e_node/environment/setup_host.sh) * **Requires password-less ssh and sudo access** * Make sure this works - e.g. `ssh -- sudo echo "ok"` * If ssh flags are required (e.g. `-i`), they can be used and passed to the tests with `--ssh-options` - * `godep go run test/e2e_node/runner/run_e2e.go --logtostderr --hosts ` + * `go run test/e2e_node/runner/run_e2e.go --logtostderr --hosts ` * **Must be run from kubernetes root** * requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`, `github.com/onsi/ginkgo/ginkgo` 3. Alternatively, manually build and copy `e2e_node_test.tar.gz` to a remote host - * Build the tar.gz `godep go run test/e2e_node/runner/run_e2e.go --logtostderr --build-only` + * Build the tar.gz `go run test/e2e_node/runner/run_e2e.go --logtostderr --build-only` * requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`, `github.com/onsi/ginkgo/ginkgo` * Copy `e2e_node_test.tar.gz` to the remote host * Extract the archive on the remote host `tar -xzvf e2e_node_test.tar.gz` diff --git a/docs/devel/flaky-tests.md b/docs/devel/flaky-tests.md index cd27c20099..e757021ff2 100644 --- a/docs/devel/flaky-tests.md +++ b/docs/devel/flaky-tests.md @@ -107,7 +107,7 @@ $ go install golang.org/x/tools/cmd/stress Then build your test binary ``` -$ godep go test -c -race +$ go test -c -race ``` Then run it under stress diff --git a/docs/devel/testing.md b/docs/devel/testing.md index e415e4429f..72f1c32823 100644 --- a/docs/devel/testing.md +++ b/docs/devel/testing.md @@ -84,10 +84,10 @@ hack/test-go.sh # Run all unit tests. cd kubernetes # Run all tests under pkg (requires client to be in $GOPATH/src/k8s.io) -godep go test ./pkg/... +go test ./pkg/... # Run all tests in the pkg/api (but not subpackages) -godep go test ./pkg/api +go test ./pkg/api ``` ### Stress running unit tests @@ -135,7 +135,7 @@ To run benchmark tests, you'll typically use something like: ```sh cd kubernetes -godep go test ./pkg/apiserver -benchmem -run=XXX -bench=BenchmarkWatch +go test ./pkg/apiserver -benchmem -run=XXX -bench=BenchmarkWatch ``` This will do the following: diff --git a/examples/https-nginx/Makefile b/examples/https-nginx/Makefile index be53807d19..9f29cb5a93 100644 --- a/examples/https-nginx/Makefile +++ b/examples/https-nginx/Makefile @@ -25,7 +25,7 @@ keys: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $(KEY) -out $(CERT) -subj "/CN=nginxsvc/O=nginxsvc" secret: - godep go run make_secret.go -crt $(CERT) -key $(KEY) > $(SECRET) + go run make_secret.go -crt $(CERT) -key $(KEY) > $(SECRET) container: docker build -t $(PREFIX):$(TAG) . diff --git a/hack/after-build/update-generated-protobuf.sh b/hack/after-build/update-generated-protobuf.sh index ce3ffc46c8..c8d45e7d20 100755 --- a/hack/after-build/update-generated-protobuf.sh +++ b/hack/after-build/update-generated-protobuf.sh @@ -42,5 +42,5 @@ gotoprotobuf=$(kube::util::find-binary "go-to-protobuf") # satisfies import of github.com/gogo/protobuf/gogoproto/gogo.proto and the core Google protobuf types PATH="${KUBE_ROOT}/_output/local/go/bin:${PATH}" \ "${gotoprotobuf}" \ - --proto-import="${KUBE_ROOT}/Godeps/_workspace/src" \ + --proto-import="${KUBE_ROOT}/vendor" \ --proto-import="${KUBE_ROOT}/third_party/protobuf" diff --git a/hack/after-build/verify-description.sh b/hack/after-build/verify-description.sh index d1eebc97f8..74243014fa 100755 --- a/hack/after-build/verify-description.sh +++ b/hack/after-build/verify-description.sh @@ -38,7 +38,7 @@ find_files() { -o -wholename './release' \ -o -wholename './target' \ -o -wholename '*/third_party/*' \ - -o -wholename '*/Godeps/*' \ + -o -wholename '*/vendor/*' \ \) -prune \ \) \ \( -wholename '*pkg/api/v*/types.go' \ diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index eae343382d..5ad8537c18 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -105,7 +105,7 @@ def file_passes(filename, refs, regexs): def file_extension(filename): return os.path.splitext(filename)[1].split(".")[-1].lower() -skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh', 'vendor'] +skipped_dirs = ['vendor', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh', 'vendor'] def normalize_files(files): newfiles = [] for pathname in files: diff --git a/hack/jenkins/test-dockerized.sh b/hack/jenkins/test-dockerized.sh index d4642a33a3..2312875291 100755 --- a/hack/jenkins/test-dockerized.sh +++ b/hack/jenkins/test-dockerized.sh @@ -52,7 +52,7 @@ export LOG_LEVEL=4 cd /go/src/k8s.io/kubernetes ./hack/build-go.sh -godep go install ./... +go install ./cmd/... ./hack/install-etcd.sh ./hack/verify-all.sh -v diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 0da2a2fc46..175ef361fc 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -113,7 +113,7 @@ kube::golang::test_targets() { cmd/genswaggertypedocs cmd/linkcheck examples/k8petstore/web-server/src - github.com/onsi/ginkgo/ginkgo + vendor/github.com/onsi/ginkgo/ginkgo test/e2e/e2e.test test/e2e_node/e2e_node.test ) @@ -257,15 +257,14 @@ kube::golang::create_gopath_tree() { # ${PATH}. If not running on Travis, it will also check that the Go version is # good enough for the Kubernetes build. # -# Input Vars: +# Inputs: # KUBE_EXTRA_GOPATH - If set, this is included in created GOPATH -# KUBE_NO_GODEPS - If set, we don't add 'Godeps/_workspace' to GOPATH # -# Output Vars: -# export GOPATH - A modified GOPATH to our created tree along with extra -# stuff. -# export GOBIN - This is actively unset if already set as we want binaries -# placed in a predictable place. +# Outputs: +# env-var GOPATH points to our local output dir +# env-var GOBIN is unset (we want binaries in a predictable place) +# env-var GO15VENDOREXPERIMENT=1 +# current directory is within GOPATH kube::golang::setup_env() { kube::golang::create_gopath_tree @@ -293,22 +292,26 @@ EOF fi fi - GOPATH=${KUBE_GOPATH} + export GOPATH=${KUBE_GOPATH} # Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined. if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then GOPATH="${GOPATH}:${KUBE_EXTRA_GOPATH}" fi - # Append the tree maintained by `godep` to the GOPATH unless KUBE_NO_GODEPS - # is defined. - if [[ -z ${KUBE_NO_GODEPS:-} ]]; then - GOPATH="${GOPATH}:${KUBE_ROOT}/Godeps/_workspace" - fi - export GOPATH + # Change directories so that we are within the GOPATH. Some tools get really + # upset if this is not true. We use a whole fake GOPATH here to collect the + # resultant binaries. Go will not let us use GOBIN with `go install` and + # cross-compiling, and `go install -o ` only works for a single pkg. + local subdir + subdir=$(pwd | sed "s|$KUBE_ROOT||") + cd "${KUBE_GOPATH}/src/${KUBE_GO_PACKAGE}/${subdir}" # Unset GOBIN in case it already exists in the current session. unset GOBIN + + # This seems to matter to some tools (godep, ugorji, ginkgo...) + export GO15VENDOREXPERIMENT=1 } # This will take binaries from $GOPATH/bin and copy them to the appropriate @@ -334,20 +337,12 @@ kube::golang::place_bins() { platform_src="" fi - local gopaths=("${KUBE_GOPATH}") - # If targets were built inside Godeps, then we need to sync from there too. - if [[ -z ${KUBE_NO_GODEPS:-} ]]; then - gopaths+=("${KUBE_ROOT}/Godeps/_workspace") + local full_binpath_src="${KUBE_GOPATH}/bin${platform_src}" + if [[ -d "${full_binpath_src}" ]]; then + mkdir -p "${KUBE_OUTPUT_BINPATH}/${platform}" + find "${full_binpath_src}" -maxdepth 1 -type f -exec \ + rsync -pt {} "${KUBE_OUTPUT_BINPATH}/${platform}" \; fi - local gopath - for gopath in "${gopaths[@]}"; do - local full_binpath_src="${gopath}/bin${platform_src}" - if [[ -d "${full_binpath_src}" ]]; then - mkdir -p "${KUBE_OUTPUT_BINPATH}/${platform}" - find "${full_binpath_src}" -maxdepth 1 -type f -exec \ - rsync -pt {} "${KUBE_OUTPUT_BINPATH}/${platform}" \; - fi - done done } diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 6163743112..6a7e34749c 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -246,10 +246,10 @@ kube::util::gen-analytics() { else dir="${path}" fi - # We don't touch files in Godeps|third_party|_gopath, and the kubectl - # docs are autogenerated by gendocs. + # We don't touch files in special dirs, and the kubectl docs are + # autogenerated by gendocs. mdfiles=($( find "${dir}" -name "*.md" -type f \ - -not -path "${path}/Godeps/*" \ + -not -path "${path}/vendor/*" \ -not -path "${path}/third_party/*" \ -not -path "${path}/_gopath/*" \ -not -path "${path}/_output/*" \ diff --git a/hack/test-go.sh b/hack/test-go.sh index 1e125b632b..052dbc1fcd 100755 --- a/hack/test-go.sh +++ b/hack/test-go.sh @@ -31,7 +31,6 @@ kube::test::find_dirs() { -path './_artifacts/*' \ -o -path './_output/*' \ -o -path './_gopath/*' \ - -o -path './Godeps/*' \ -o -path './contrib/podex/*' \ -o -path './output/*' \ -o -path './release/*' \ @@ -40,6 +39,8 @@ kube::test::find_dirs() { -o -path './test/e2e_node/*' \ -o -path './test/integration/*' \ -o -path './test/component/scheduler/perf/*' \ + -o -path './third_party/*'\ + -o -path './vendor/*'\ \) -prune \ \) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u ) diff --git a/hack/update-codecgen.sh b/hack/update-codecgen.sh index d2699ff15f..b37056304e 100755 --- a/hack/update-codecgen.sh +++ b/hack/update-codecgen.sh @@ -34,7 +34,7 @@ generated_files=($( -o -wholename './release' \ -o -wholename './target' \ -o -wholename '*/third_party/*' \ - -o -wholename '*/Godeps/*' \ + -o -wholename '*/vendor/*' \ -o -wholename '*/codecgen-*-1234.generated.go' \ \) -prune \ \) -name '*.generated.go' | sort -r)) @@ -117,7 +117,7 @@ fi echo "Building codecgen" CODECGEN="${PWD}/codecgen_binary" -godep go build -o "${CODECGEN}" github.com/ugorji/go/codec/codecgen +go build -o "${CODECGEN}" ./vendor/github.com/ugorji/go/codec/codecgen # Running codecgen fails if some of the files doesn't compile. # Thus (since all the files are completely auto-generated and diff --git a/hack/update-gofmt.sh b/hack/update-gofmt.sh index f137a5fc0e..f6c380c2e4 100755 --- a/hack/update-gofmt.sh +++ b/hack/update-gofmt.sh @@ -40,7 +40,7 @@ find_files() { -o -wholename './release' \ -o -wholename './target' \ -o -wholename '*/third_party/*' \ - -o -wholename '*/Godeps/*' \ + -o -wholename '*/vendor/*' \ \) -prune \ \) -name '*.go' } diff --git a/hack/verify-codecgen.sh b/hack/verify-codecgen.sh index 726a1de67e..c1a65836bd 100755 --- a/hack/verify-codecgen.sh +++ b/hack/verify-codecgen.sh @@ -31,7 +31,7 @@ generated_files=($( -o -wholename './release' \ -o -wholename './target' \ -o -wholename '*/third_party/*' \ - -o -wholename '*/Godeps/*' \ + -o -wholename '*/vendor/*' \ \) -prune \ \) -name '*.generated.go')) diff --git a/hack/verify-codegen.sh b/hack/verify-codegen.sh index b6fdced5b5..475909e243 100755 --- a/hack/verify-codegen.sh +++ b/hack/verify-codegen.sh @@ -18,16 +18,17 @@ set -o errexit set -o nounset set -o pipefail -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. - KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/client-gen -"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/conversion-gen -"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/deepcopy-gen -"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/set-gen +BUILD_TARGETS=( + cmd/libs/go2idl/client-gen + cmd/libs/go2idl/conversion-gen + cmd/libs/go2idl/deepcopy-gen + cmd/libs/go2idl/set-gen +) +"${KUBE_ROOT}/hack/build-go.sh" ${BUILD_TARGETS[*]} "${KUBE_ROOT}/hack/after-build/run-codegen.sh" --verify-only diff --git a/hack/verify-flags-underscore.py b/hack/verify-flags-underscore.py index 2e695cba76..1fc4ed35a4 100755 --- a/hack/verify-flags-underscore.py +++ b/hack/verify-flags-underscore.py @@ -53,8 +53,8 @@ def get_all_files(rootdir): all_files = [] for root, dirs, files in os.walk(rootdir): # don't visit certain dirs - if 'Godeps' in dirs: - dirs.remove('Godeps') + if 'vendor' in dirs: + dirs.remove('vendor') if '_gopath' in dirs: dirs.remove('_gopath') if 'third_party' in dirs: diff --git a/hack/verify-godeps.sh b/hack/verify-godeps.sh index dbf4c47369..e60df42e4d 100755 --- a/hack/verify-godeps.sh +++ b/hack/verify-godeps.sh @@ -19,7 +19,7 @@ set -o nounset set -o pipefail # As of go 1.6, the vendor experiment is enabled by default. -export GO15VENDOREXPERIMENT=0 +export GO15VENDOREXPERIMENT=1 #### HACK #### # Sometimes godep just can't handle things. This lets use manually put diff --git a/hack/verify-gofmt.sh b/hack/verify-gofmt.sh index 0f0745ddfd..9120706174 100755 --- a/hack/verify-gofmt.sh +++ b/hack/verify-gofmt.sh @@ -40,7 +40,7 @@ find_files() { -o -wholename './release' \ -o -wholename './target' \ -o -wholename '*/third_party/*' \ - -o -wholename '*/Godeps/*' \ + -o -wholename '*/vendor/*' \ \) -prune \ \) -name '*.go' } diff --git a/hack/verify-govet.sh b/hack/verify-govet.sh index 37ccd74264..32bf2d2779 100755 --- a/hack/verify-govet.sh +++ b/hack/verify-govet.sh @@ -39,7 +39,7 @@ done if [[ ${#targets[@]} -eq 0 ]]; then # Do not run on third_party directories. - targets=$(go list ./... | grep -v "third_party") + targets=$(go list ./... | egrep -v "/(third_party|vendor)/") fi # Do this in parallel; results in 5-10x speedup. @@ -58,7 +58,7 @@ for i in $targets # # The intended result is that each incantation of this line returns # either 0 (pass) or 1 (fail). - godep go vet "${goflags[@]:+${goflags[@]}}" "$i" 2>&1 \ + go vet "${goflags[@]:+${goflags[@]}}" "$i" 2>&1 \ | grep -v -E "exit status|GO15VENDOREXPERIMENT=" \ || fail=${PIPESTATUS[0]} exit $fail diff --git a/hack/verify-import-boss.sh b/hack/verify-import-boss.sh index 619fe6d9c6..c4aace20af 100755 --- a/hack/verify-import-boss.sh +++ b/hack/verify-import-boss.sh @@ -18,8 +18,6 @@ set -o errexit set -o nounset set -o pipefail -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. - KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" diff --git a/hooks/pre-commit b/hooks/pre-commit index 4844da8240..e3ca4a24e0 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -42,7 +42,7 @@ fi echo -ne "Checking for files that need gofmt... " files_need_gofmt=() -files=($(git diff --cached --name-only --diff-filter ACM | grep "\.go" | grep -v -e "third_party" -e "Godeps")) +files=($(git diff --cached --name-only --diff-filter ACM | grep "\.go" | grep -v -e "^third_party" -e "^vendor")) for file in "${files[@]}"; do # Check for files that fail gofmt. diff="$(git show ":${file}" | gofmt -s -d 2>&1)" diff --git a/test/e2e_node/jenkins/e2e-node-jenkins.sh b/test/e2e_node/jenkins/e2e-node-jenkins.sh index 426f483a2d..9af3a89e0b 100755 --- a/test/e2e_node/jenkins/e2e-node-jenkins.sh +++ b/test/e2e_node/jenkins/e2e-node-jenkins.sh @@ -34,7 +34,7 @@ if [ "$INSTALL_GODEP" = true ] ; then go get -u github.com/onsi/gomega fi -godep go build test/e2e_node/environment/conformance.go -godep go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \ +go build test/e2e_node/environment/conformance.go +go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \ --zone="$GCE_ZONE" --project="$GCE_PROJECT" \ --hosts="$GCE_HOSTS" --images="$GCE_IMAGES" --cleanup="$CLEANUP" diff --git a/test/e2e_node/runner/run_e2e.go b/test/e2e_node/runner/run_e2e.go index 8176f68e74..4c8a06bd9c 100644 --- a/test/e2e_node/runner/run_e2e.go +++ b/test/e2e_node/runner/run_e2e.go @@ -15,9 +15,9 @@ limitations under the License. */ // To run the e2e tests against one or more hosts on gce: -// $ godep go run run_e2e.go --logtostderr --v 2 --ssh-env gce --hosts +// $ go run run_e2e.go --logtostderr --v 2 --ssh-env gce --hosts // To run the e2e tests against one or more images on gce and provision them: -// $ godep go run run_e2e.go --logtostderr --v 2 --project --zone --ssh-env gce --images +// $ go run run_e2e.go --logtostderr --v 2 --project --zone --ssh-env gce --images package main import ( diff --git a/test/images/clusterapi-tester/Makefile b/test/images/clusterapi-tester/Makefile index 952f24f1d9..9edf60f2fc 100644 --- a/test/images/clusterapi-tester/Makefile +++ b/test/images/clusterapi-tester/Makefile @@ -19,7 +19,7 @@ TAG = 1.0 PREFIX = gcr.io/google_containers/clusterapi-tester main: main.go - CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o main ./main.go + CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o main ./main.go container: main docker build -t $(PREFIX):$(TAG) . diff --git a/test/images/n-way-http/Makefile b/test/images/n-way-http/Makefile index 8a1e27450d..b11518b65d 100644 --- a/test/images/n-way-http/Makefile +++ b/test/images/n-way-http/Makefile @@ -19,7 +19,7 @@ TAG = 0.0 PREFIX = gcr.io/google_containers/n-way-http server: server.go - CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go + CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go container: server docker build -t $(PREFIX):$(TAG) . diff --git a/test/images/network-tester/Makefile b/test/images/network-tester/Makefile index 0d9ca5ba75..3738aa446c 100644 --- a/test/images/network-tester/Makefile +++ b/test/images/network-tester/Makefile @@ -18,7 +18,7 @@ PREFIX = gcr.io/google_containers all: push webserver: webserver.go - CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' ./webserver.go + CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./webserver.go container: image diff --git a/test/images/resource-consumer/Makefile b/test/images/resource-consumer/Makefile index 7a4a0b496a..b068916610 100644 --- a/test/images/resource-consumer/Makefile +++ b/test/images/resource-consumer/Makefile @@ -18,8 +18,8 @@ PREFIX = gcr.io/google_containers all: clean consumer consumer: - CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go - CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' -o consumer . + CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o consume-cpu/consume-cpu ./consume-cpu/consume_cpu.go + CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o consumer . container: image diff --git a/test/soak/cauldron/Makefile b/test/soak/cauldron/Makefile index 800327231c..11934d9302 100644 --- a/test/soak/cauldron/Makefile +++ b/test/soak/cauldron/Makefile @@ -17,7 +17,7 @@ TAG = 1.0 cauldron: - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo --ldflags '-w' cauldron.go + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' cauldron.go container: cauldron docker build -t kubernetes/cauldron:$(TAG) .