mirror of https://github.com/k3s-io/k3s
Convert everything to use vendor/
parent
3c0c5ed4e0
commit
cbf886c7f4
2
Makefile
2
Makefile
|
@ -21,7 +21,6 @@
|
||||||
# clean: Clean up.
|
# clean: Clean up.
|
||||||
|
|
||||||
OUT_DIR = _output
|
OUT_DIR = _output
|
||||||
GODEPS_PKG_DIR = Godeps/_workspace/pkg
|
|
||||||
|
|
||||||
KUBE_GOFLAGS = $(GOFLAGS)
|
KUBE_GOFLAGS = $(GOFLAGS)
|
||||||
export KUBE_GOFLAGS
|
export KUBE_GOFLAGS
|
||||||
|
@ -111,7 +110,6 @@ test_e2e_node:
|
||||||
clean:
|
clean:
|
||||||
build/make-clean.sh
|
build/make-clean.sh
|
||||||
rm -rf $(OUT_DIR)
|
rm -rf $(OUT_DIR)
|
||||||
rm -rf $(GODEPS_PKG_DIR)
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
# Run 'go vet'.
|
# Run 'go vet'.
|
||||||
|
|
|
@ -77,13 +77,10 @@ readonly DOCKER_MOUNT_ARGS_BASE=(
|
||||||
--volume /etc/localtime:/etc/localtime:ro
|
--volume /etc/localtime:/etc/localtime:ro
|
||||||
)
|
)
|
||||||
|
|
||||||
# We create a Docker data container to cache incremental build artifacts. We
|
# We create a Docker data container to cache incremental build artifacts.
|
||||||
# need to cache both the go tree in _output and the go tree under Godeps.
|
|
||||||
readonly REMOTE_OUTPUT_GOPATH="${REMOTE_OUTPUT_SUBPATH}/go"
|
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=(
|
readonly DOCKER_DATA_MOUNT_ARGS=(
|
||||||
--volume "${REMOTE_OUTPUT_GOPATH}"
|
--volume "${REMOTE_OUTPUT_GOPATH}"
|
||||||
--volume "${REMOTE_GODEP_GOPATH}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# This is where the final release artifacts are created locally
|
# This is where the final release artifacts are created locally
|
||||||
|
@ -465,7 +462,6 @@ function kube::build::source_targets() {
|
||||||
docs
|
docs
|
||||||
examples
|
examples
|
||||||
federation
|
federation
|
||||||
Godeps/_workspace/src
|
|
||||||
Godeps/Godeps.json
|
Godeps/Godeps.json
|
||||||
hack
|
hack
|
||||||
LICENSE
|
LICENSE
|
||||||
|
@ -475,6 +471,7 @@ function kube::build::source_targets() {
|
||||||
README.md
|
README.md
|
||||||
test
|
test
|
||||||
third_party
|
third_party
|
||||||
|
vendor
|
||||||
contrib/completions/bash/kubectl
|
contrib/completions/bash/kubectl
|
||||||
contrib/mesos
|
contrib/mesos
|
||||||
.generated_docs
|
.generated_docs
|
||||||
|
@ -547,6 +544,16 @@ function kube::build::clean_images() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function kube::build::ensure_data_container() {
|
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
|
if ! "${DOCKER[@]}" inspect "${KUBE_BUILD_DATA_CONTAINER_NAME}" >/dev/null 2>&1; then
|
||||||
kube::log::status "Creating data container"
|
kube::log::status "Creating data container"
|
||||||
local -ra docker_cmd=(
|
local -ra docker_cmd=(
|
||||||
|
|
|
@ -46,7 +46,7 @@ all: container
|
||||||
|
|
||||||
kube2sky: kube2sky.go
|
kube2sky: kube2sky.go
|
||||||
# Only build kube2sky. This requires go and godep in PATH
|
# 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:
|
container:
|
||||||
# Copy the content in this dir to the temp dir
|
# Copy the content in this dir to the temp dir
|
||||||
|
@ -80,7 +80,7 @@ clean:
|
||||||
rm -f kube2sky
|
rm -f kube2sky
|
||||||
|
|
||||||
test: clean
|
test: clean
|
||||||
godep go test -v --vmodule=*=4
|
go test -v --vmodule=*=4
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all kube2sky container push clean test
|
.PHONY: all kube2sky container push clean test
|
||||||
|
|
|
@ -29,7 +29,7 @@ import (
|
||||||
func construct(t *testing.T, files map[string]string) *generator.Context {
|
func construct(t *testing.T, files map[string]string) *generator.Context {
|
||||||
b := parser.New()
|
b := parser.New()
|
||||||
for name, src := range files {
|
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)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ func New() *Generator {
|
||||||
OutputBase: sourceTree,
|
OutputBase: sourceTree,
|
||||||
GoHeaderFilePath: filepath.Join(sourceTree, "k8s.io/kubernetes/hack/boilerplate/boilerplate.go.txt"),
|
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{
|
return &Generator{
|
||||||
Common: common,
|
Common: common,
|
||||||
OutputBase: sourceTree,
|
OutputBase: sourceTree,
|
||||||
|
|
|
@ -193,7 +193,7 @@ godep v53 (linux/amd64/go1.5.3)
|
||||||
|
|
||||||
### Using godep
|
### 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:
|
1) Devote a directory to this endeavor:
|
||||||
|
|
||||||
|
|
|
@ -82,12 +82,12 @@ See [setup_host.sh](../../test/e2e_node/environment/setup_host.sh)
|
||||||
* **Requires password-less ssh and sudo access**
|
* **Requires password-less ssh and sudo access**
|
||||||
* Make sure this works - e.g. `ssh <hostname> -- sudo echo "ok"`
|
* Make sure this works - e.g. `ssh <hostname> -- sudo echo "ok"`
|
||||||
* If ssh flags are required (e.g. `-i`), they can be used and passed to the tests with `--ssh-options`
|
* 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 <comma separated hosts>`
|
* `go run test/e2e_node/runner/run_e2e.go --logtostderr --hosts <comma separated hosts>`
|
||||||
* **Must be run from kubernetes root**
|
* **Must be run from kubernetes root**
|
||||||
* requires (go get): `github.com/tools/godep`, `github.com/onsi/gomega`, `github.com/onsi/ginkgo/ginkgo`
|
* 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
|
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`
|
* 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
|
* Copy `e2e_node_test.tar.gz` to the remote host
|
||||||
* Extract the archive on the remote host `tar -xzvf e2e_node_test.tar.gz`
|
* Extract the archive on the remote host `tar -xzvf e2e_node_test.tar.gz`
|
||||||
|
|
|
@ -107,7 +107,7 @@ $ go install golang.org/x/tools/cmd/stress
|
||||||
Then build your test binary
|
Then build your test binary
|
||||||
|
|
||||||
```
|
```
|
||||||
$ godep go test -c -race
|
$ go test -c -race
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run it under stress
|
Then run it under stress
|
||||||
|
|
|
@ -84,10 +84,10 @@ hack/test-go.sh # Run all unit tests.
|
||||||
cd kubernetes
|
cd kubernetes
|
||||||
|
|
||||||
# Run all tests under pkg (requires client to be in $GOPATH/src/k8s.io)
|
# 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)
|
# Run all tests in the pkg/api (but not subpackages)
|
||||||
godep go test ./pkg/api
|
go test ./pkg/api
|
||||||
```
|
```
|
||||||
|
|
||||||
### Stress running unit tests
|
### Stress running unit tests
|
||||||
|
@ -135,7 +135,7 @@ To run benchmark tests, you'll typically use something like:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd kubernetes
|
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:
|
This will do the following:
|
||||||
|
|
|
@ -25,7 +25,7 @@ keys:
|
||||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $(KEY) -out $(CERT) -subj "/CN=nginxsvc/O=nginxsvc"
|
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $(KEY) -out $(CERT) -subj "/CN=nginxsvc/O=nginxsvc"
|
||||||
|
|
||||||
secret:
|
secret:
|
||||||
godep go run make_secret.go -crt $(CERT) -key $(KEY) > $(SECRET)
|
go run make_secret.go -crt $(CERT) -key $(KEY) > $(SECRET)
|
||||||
|
|
||||||
container:
|
container:
|
||||||
docker build -t $(PREFIX):$(TAG) .
|
docker build -t $(PREFIX):$(TAG) .
|
||||||
|
|
|
@ -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
|
# satisfies import of github.com/gogo/protobuf/gogoproto/gogo.proto and the core Google protobuf types
|
||||||
PATH="${KUBE_ROOT}/_output/local/go/bin:${PATH}" \
|
PATH="${KUBE_ROOT}/_output/local/go/bin:${PATH}" \
|
||||||
"${gotoprotobuf}" \
|
"${gotoprotobuf}" \
|
||||||
--proto-import="${KUBE_ROOT}/Godeps/_workspace/src" \
|
--proto-import="${KUBE_ROOT}/vendor" \
|
||||||
--proto-import="${KUBE_ROOT}/third_party/protobuf"
|
--proto-import="${KUBE_ROOT}/third_party/protobuf"
|
||||||
|
|
|
@ -38,7 +38,7 @@ find_files() {
|
||||||
-o -wholename './release' \
|
-o -wholename './release' \
|
||||||
-o -wholename './target' \
|
-o -wholename './target' \
|
||||||
-o -wholename '*/third_party/*' \
|
-o -wholename '*/third_party/*' \
|
||||||
-o -wholename '*/Godeps/*' \
|
-o -wholename '*/vendor/*' \
|
||||||
\) -prune \
|
\) -prune \
|
||||||
\) \
|
\) \
|
||||||
\( -wholename '*pkg/api/v*/types.go' \
|
\( -wholename '*pkg/api/v*/types.go' \
|
||||||
|
|
|
@ -105,7 +105,7 @@ def file_passes(filename, refs, regexs):
|
||||||
def file_extension(filename):
|
def file_extension(filename):
|
||||||
return os.path.splitext(filename)[1].split(".")[-1].lower()
|
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):
|
def normalize_files(files):
|
||||||
newfiles = []
|
newfiles = []
|
||||||
for pathname in files:
|
for pathname in files:
|
||||||
|
|
|
@ -52,7 +52,7 @@ export LOG_LEVEL=4
|
||||||
cd /go/src/k8s.io/kubernetes
|
cd /go/src/k8s.io/kubernetes
|
||||||
|
|
||||||
./hack/build-go.sh
|
./hack/build-go.sh
|
||||||
godep go install ./...
|
go install ./cmd/...
|
||||||
./hack/install-etcd.sh
|
./hack/install-etcd.sh
|
||||||
|
|
||||||
./hack/verify-all.sh -v
|
./hack/verify-all.sh -v
|
||||||
|
|
|
@ -113,7 +113,7 @@ kube::golang::test_targets() {
|
||||||
cmd/genswaggertypedocs
|
cmd/genswaggertypedocs
|
||||||
cmd/linkcheck
|
cmd/linkcheck
|
||||||
examples/k8petstore/web-server/src
|
examples/k8petstore/web-server/src
|
||||||
github.com/onsi/ginkgo/ginkgo
|
vendor/github.com/onsi/ginkgo/ginkgo
|
||||||
test/e2e/e2e.test
|
test/e2e/e2e.test
|
||||||
test/e2e_node/e2e_node.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
|
# ${PATH}. If not running on Travis, it will also check that the Go version is
|
||||||
# good enough for the Kubernetes build.
|
# good enough for the Kubernetes build.
|
||||||
#
|
#
|
||||||
# Input Vars:
|
# Inputs:
|
||||||
# KUBE_EXTRA_GOPATH - If set, this is included in created GOPATH
|
# 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:
|
# Outputs:
|
||||||
# export GOPATH - A modified GOPATH to our created tree along with extra
|
# env-var GOPATH points to our local output dir
|
||||||
# stuff.
|
# env-var GOBIN is unset (we want binaries in a predictable place)
|
||||||
# export GOBIN - This is actively unset if already set as we want binaries
|
# env-var GO15VENDOREXPERIMENT=1
|
||||||
# placed in a predictable place.
|
# current directory is within GOPATH
|
||||||
kube::golang::setup_env() {
|
kube::golang::setup_env() {
|
||||||
kube::golang::create_gopath_tree
|
kube::golang::create_gopath_tree
|
||||||
|
|
||||||
|
@ -293,22 +292,26 @@ EOF
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GOPATH=${KUBE_GOPATH}
|
export GOPATH=${KUBE_GOPATH}
|
||||||
|
|
||||||
# Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined.
|
# Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined.
|
||||||
if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then
|
if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then
|
||||||
GOPATH="${GOPATH}:${KUBE_EXTRA_GOPATH}"
|
GOPATH="${GOPATH}:${KUBE_EXTRA_GOPATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Append the tree maintained by `godep` to the GOPATH unless KUBE_NO_GODEPS
|
# Change directories so that we are within the GOPATH. Some tools get really
|
||||||
# is defined.
|
# upset if this is not true. We use a whole fake GOPATH here to collect the
|
||||||
if [[ -z ${KUBE_NO_GODEPS:-} ]]; then
|
# resultant binaries. Go will not let us use GOBIN with `go install` and
|
||||||
GOPATH="${GOPATH}:${KUBE_ROOT}/Godeps/_workspace"
|
# cross-compiling, and `go install -o <file>` only works for a single pkg.
|
||||||
fi
|
local subdir
|
||||||
export GOPATH
|
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 in case it already exists in the current session.
|
||||||
unset GOBIN
|
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
|
# This will take binaries from $GOPATH/bin and copy them to the appropriate
|
||||||
|
@ -334,21 +337,13 @@ kube::golang::place_bins() {
|
||||||
platform_src=""
|
platform_src=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local gopaths=("${KUBE_GOPATH}")
|
local full_binpath_src="${KUBE_GOPATH}/bin${platform_src}"
|
||||||
# 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")
|
|
||||||
fi
|
|
||||||
local gopath
|
|
||||||
for gopath in "${gopaths[@]}"; do
|
|
||||||
local full_binpath_src="${gopath}/bin${platform_src}"
|
|
||||||
if [[ -d "${full_binpath_src}" ]]; then
|
if [[ -d "${full_binpath_src}" ]]; then
|
||||||
mkdir -p "${KUBE_OUTPUT_BINPATH}/${platform}"
|
mkdir -p "${KUBE_OUTPUT_BINPATH}/${platform}"
|
||||||
find "${full_binpath_src}" -maxdepth 1 -type f -exec \
|
find "${full_binpath_src}" -maxdepth 1 -type f -exec \
|
||||||
rsync -pt {} "${KUBE_OUTPUT_BINPATH}/${platform}" \;
|
rsync -pt {} "${KUBE_OUTPUT_BINPATH}/${platform}" \;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kube::golang::fallback_if_stdlib_not_installable() {
|
kube::golang::fallback_if_stdlib_not_installable() {
|
||||||
|
|
|
@ -246,10 +246,10 @@ kube::util::gen-analytics() {
|
||||||
else
|
else
|
||||||
dir="${path}"
|
dir="${path}"
|
||||||
fi
|
fi
|
||||||
# We don't touch files in Godeps|third_party|_gopath, and the kubectl
|
# We don't touch files in special dirs, and the kubectl docs are
|
||||||
# docs are autogenerated by gendocs.
|
# autogenerated by gendocs.
|
||||||
mdfiles=($( find "${dir}" -name "*.md" -type f \
|
mdfiles=($( find "${dir}" -name "*.md" -type f \
|
||||||
-not -path "${path}/Godeps/*" \
|
-not -path "${path}/vendor/*" \
|
||||||
-not -path "${path}/third_party/*" \
|
-not -path "${path}/third_party/*" \
|
||||||
-not -path "${path}/_gopath/*" \
|
-not -path "${path}/_gopath/*" \
|
||||||
-not -path "${path}/_output/*" \
|
-not -path "${path}/_output/*" \
|
||||||
|
|
|
@ -31,7 +31,6 @@ kube::test::find_dirs() {
|
||||||
-path './_artifacts/*' \
|
-path './_artifacts/*' \
|
||||||
-o -path './_output/*' \
|
-o -path './_output/*' \
|
||||||
-o -path './_gopath/*' \
|
-o -path './_gopath/*' \
|
||||||
-o -path './Godeps/*' \
|
|
||||||
-o -path './contrib/podex/*' \
|
-o -path './contrib/podex/*' \
|
||||||
-o -path './output/*' \
|
-o -path './output/*' \
|
||||||
-o -path './release/*' \
|
-o -path './release/*' \
|
||||||
|
@ -40,6 +39,8 @@ kube::test::find_dirs() {
|
||||||
-o -path './test/e2e_node/*' \
|
-o -path './test/e2e_node/*' \
|
||||||
-o -path './test/integration/*' \
|
-o -path './test/integration/*' \
|
||||||
-o -path './test/component/scheduler/perf/*' \
|
-o -path './test/component/scheduler/perf/*' \
|
||||||
|
-o -path './third_party/*'\
|
||||||
|
-o -path './vendor/*'\
|
||||||
\) -prune \
|
\) -prune \
|
||||||
\) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u
|
\) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,7 +34,7 @@ generated_files=($(
|
||||||
-o -wholename './release' \
|
-o -wholename './release' \
|
||||||
-o -wholename './target' \
|
-o -wholename './target' \
|
||||||
-o -wholename '*/third_party/*' \
|
-o -wholename '*/third_party/*' \
|
||||||
-o -wholename '*/Godeps/*' \
|
-o -wholename '*/vendor/*' \
|
||||||
-o -wholename '*/codecgen-*-1234.generated.go' \
|
-o -wholename '*/codecgen-*-1234.generated.go' \
|
||||||
\) -prune \
|
\) -prune \
|
||||||
\) -name '*.generated.go' | sort -r))
|
\) -name '*.generated.go' | sort -r))
|
||||||
|
@ -117,7 +117,7 @@ fi
|
||||||
|
|
||||||
echo "Building codecgen"
|
echo "Building codecgen"
|
||||||
CODECGEN="${PWD}/codecgen_binary"
|
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.
|
# Running codecgen fails if some of the files doesn't compile.
|
||||||
# Thus (since all the files are completely auto-generated and
|
# Thus (since all the files are completely auto-generated and
|
||||||
|
|
|
@ -40,7 +40,7 @@ find_files() {
|
||||||
-o -wholename './release' \
|
-o -wholename './release' \
|
||||||
-o -wholename './target' \
|
-o -wholename './target' \
|
||||||
-o -wholename '*/third_party/*' \
|
-o -wholename '*/third_party/*' \
|
||||||
-o -wholename '*/Godeps/*' \
|
-o -wholename '*/vendor/*' \
|
||||||
\) -prune \
|
\) -prune \
|
||||||
\) -name '*.go'
|
\) -name '*.go'
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ generated_files=($(
|
||||||
-o -wholename './release' \
|
-o -wholename './release' \
|
||||||
-o -wholename './target' \
|
-o -wholename './target' \
|
||||||
-o -wholename '*/third_party/*' \
|
-o -wholename '*/third_party/*' \
|
||||||
-o -wholename '*/Godeps/*' \
|
-o -wholename '*/vendor/*' \
|
||||||
\) -prune \
|
\) -prune \
|
||||||
\) -name '*.generated.go'))
|
\) -name '*.generated.go'))
|
||||||
|
|
||||||
|
|
|
@ -18,16 +18,17 @@ set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
kube::golang::setup_env
|
kube::golang::setup_env
|
||||||
|
|
||||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/client-gen
|
BUILD_TARGETS=(
|
||||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/conversion-gen
|
cmd/libs/go2idl/client-gen
|
||||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/deepcopy-gen
|
cmd/libs/go2idl/conversion-gen
|
||||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/set-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
|
"${KUBE_ROOT}/hack/after-build/run-codegen.sh" --verify-only
|
||||||
|
|
|
@ -53,8 +53,8 @@ def get_all_files(rootdir):
|
||||||
all_files = []
|
all_files = []
|
||||||
for root, dirs, files in os.walk(rootdir):
|
for root, dirs, files in os.walk(rootdir):
|
||||||
# don't visit certain dirs
|
# don't visit certain dirs
|
||||||
if 'Godeps' in dirs:
|
if 'vendor' in dirs:
|
||||||
dirs.remove('Godeps')
|
dirs.remove('vendor')
|
||||||
if '_gopath' in dirs:
|
if '_gopath' in dirs:
|
||||||
dirs.remove('_gopath')
|
dirs.remove('_gopath')
|
||||||
if 'third_party' in dirs:
|
if 'third_party' in dirs:
|
||||||
|
|
|
@ -19,7 +19,7 @@ set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# As of go 1.6, the vendor experiment is enabled by default.
|
# As of go 1.6, the vendor experiment is enabled by default.
|
||||||
export GO15VENDOREXPERIMENT=0
|
export GO15VENDOREXPERIMENT=1
|
||||||
|
|
||||||
#### HACK ####
|
#### HACK ####
|
||||||
# Sometimes godep just can't handle things. This lets use manually put
|
# Sometimes godep just can't handle things. This lets use manually put
|
||||||
|
|
|
@ -40,7 +40,7 @@ find_files() {
|
||||||
-o -wholename './release' \
|
-o -wholename './release' \
|
||||||
-o -wholename './target' \
|
-o -wholename './target' \
|
||||||
-o -wholename '*/third_party/*' \
|
-o -wholename '*/third_party/*' \
|
||||||
-o -wholename '*/Godeps/*' \
|
-o -wholename '*/vendor/*' \
|
||||||
\) -prune \
|
\) -prune \
|
||||||
\) -name '*.go'
|
\) -name '*.go'
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ done
|
||||||
|
|
||||||
if [[ ${#targets[@]} -eq 0 ]]; then
|
if [[ ${#targets[@]} -eq 0 ]]; then
|
||||||
# Do not run on third_party directories.
|
# Do not run on third_party directories.
|
||||||
targets=$(go list ./... | grep -v "third_party")
|
targets=$(go list ./... | egrep -v "/(third_party|vendor)/")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Do this in parallel; results in 5-10x speedup.
|
# 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
|
# The intended result is that each incantation of this line returns
|
||||||
# either 0 (pass) or 1 (fail).
|
# 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=" \
|
| grep -v -E "exit status|GO15VENDOREXPERIMENT=" \
|
||||||
|| fail=${PIPESTATUS[0]}
|
|| fail=${PIPESTATUS[0]}
|
||||||
exit $fail
|
exit $fail
|
||||||
|
|
|
@ -18,8 +18,6 @@ set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ fi
|
||||||
|
|
||||||
echo -ne "Checking for files that need gofmt... "
|
echo -ne "Checking for files that need gofmt... "
|
||||||
files_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
|
for file in "${files[@]}"; do
|
||||||
# Check for files that fail gofmt.
|
# Check for files that fail gofmt.
|
||||||
diff="$(git show ":${file}" | gofmt -s -d 2>&1)"
|
diff="$(git show ":${file}" | gofmt -s -d 2>&1)"
|
||||||
|
|
|
@ -34,7 +34,7 @@ if [ "$INSTALL_GODEP" = true ] ; then
|
||||||
go get -u github.com/onsi/gomega
|
go get -u github.com/onsi/gomega
|
||||||
fi
|
fi
|
||||||
|
|
||||||
godep go build test/e2e_node/environment/conformance.go
|
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 run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \
|
||||||
--zone="$GCE_ZONE" --project="$GCE_PROJECT" \
|
--zone="$GCE_ZONE" --project="$GCE_PROJECT" \
|
||||||
--hosts="$GCE_HOSTS" --images="$GCE_IMAGES" --cleanup="$CLEANUP"
|
--hosts="$GCE_HOSTS" --images="$GCE_IMAGES" --cleanup="$CLEANUP"
|
||||||
|
|
|
@ -15,9 +15,9 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// To run the e2e tests against one or more hosts on gce:
|
// 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 <comma separated hosts>
|
// $ go run run_e2e.go --logtostderr --v 2 --ssh-env gce --hosts <comma separated hosts>
|
||||||
// To run the e2e tests against one or more images on gce and provision them:
|
// 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 <project> --zone <zone> --ssh-env gce --images <comma separated images>
|
// $ go run run_e2e.go --logtostderr --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -19,7 +19,7 @@ TAG = 1.0
|
||||||
PREFIX = gcr.io/google_containers/clusterapi-tester
|
PREFIX = gcr.io/google_containers/clusterapi-tester
|
||||||
|
|
||||||
main: main.go
|
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
|
container: main
|
||||||
docker build -t $(PREFIX):$(TAG) .
|
docker build -t $(PREFIX):$(TAG) .
|
||||||
|
|
|
@ -19,7 +19,7 @@ TAG = 0.0
|
||||||
PREFIX = gcr.io/google_containers/n-way-http
|
PREFIX = gcr.io/google_containers/n-way-http
|
||||||
|
|
||||||
server: server.go
|
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
|
container: server
|
||||||
docker build -t $(PREFIX):$(TAG) .
|
docker build -t $(PREFIX):$(TAG) .
|
||||||
|
|
|
@ -18,7 +18,7 @@ PREFIX = gcr.io/google_containers
|
||||||
all: push
|
all: push
|
||||||
|
|
||||||
webserver: webserver.go
|
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
|
container: image
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ PREFIX = gcr.io/google_containers
|
||||||
all: clean consumer
|
all: clean consumer
|
||||||
|
|
||||||
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 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 consumer .
|
||||||
|
|
||||||
container: image
|
container: image
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
TAG = 1.0
|
TAG = 1.0
|
||||||
|
|
||||||
cauldron:
|
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
|
container: cauldron
|
||||||
docker build -t kubernetes/cauldron:$(TAG) .
|
docker build -t kubernetes/cauldron:$(TAG) .
|
||||||
|
|
Loading…
Reference in New Issue