diff --git a/Makefile b/Makefile index 1e02f25c..209d887a 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -GO := godep go +GO := go pkgs = $(shell $(GO) list ./...) all: format build test diff --git a/build/boilerplate/boilerplate.py b/build/boilerplate/boilerplate.py index c5c16e7b..bd7e5f6a 100755 --- a/build/boilerplate/boilerplate.py +++ b/build/boilerplate/boilerplate.py @@ -95,7 +95,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'] +skipped_dirs = ['Godeps', 'vendor', 'third_party', '_gopath', '_output', '.git'] def normalize_files(files): newfiles = [] for pathname in files: diff --git a/build/build.sh b/build/build.sh index 46c6f1e3..3775c382 100755 --- a/build/build.sh +++ b/build/build.sh @@ -68,6 +68,6 @@ if [ "$RELEASE" == "true" ]; then echo "Building release candidate with -ldflags $ldflags" fi -GOBIN=$PWD godep go "$GO_CMD" ${GO_FLAGS} -ldflags "${ldflags}" "${repo_path}" +GOBIN=$PWD go "$GO_CMD" ${GO_FLAGS} -ldflags "${ldflags}" "${repo_path}" exit 0 diff --git a/build/check_errorf.sh b/build/check_errorf.sh index f9259c95..3645cef0 100755 --- a/build/check_errorf.sh +++ b/build/check_errorf.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -GO_FILES=$(find . -not -wholename "*Godeps*" -name "*.go") +GO_FILES=$(find . -not -wholename "*Godeps*" -not -wholename "*vendor*" -name "*.go") for FILE in ${GO_FILES}; do ERRS=`grep 'fmt.Errorf("[A-Z]' ${FILE}` diff --git a/build/check_gofmt.sh b/build/check_gofmt.sh index b742c398..65049074 100755 --- a/build/check_gofmt.sh +++ b/build/check_gofmt.sh @@ -21,7 +21,7 @@ if [ $# -ne 1 ]; then fi # Check formatting on non Godep'd code. -GOFMT_PATHS=$(find . -not -wholename "*.git*" -not -wholename "*Godeps*" -not -name "." -type d) +GOFMT_PATHS=$(find . -not -wholename "*.git*" -not -wholename "*Godeps*" -not -wholename "*vendor*" -not -name "." -type d) # Find any files with gofmt problems BAD_FILES=$(gofmt -s -l $GOFMT_PATHS) diff --git a/build/integration.sh b/build/integration.sh index da45c4c0..e5450191 100755 --- a/build/integration.sh +++ b/build/integration.sh @@ -57,4 +57,4 @@ while [ "$(curl -Gs http://localhost:8080/healthz)" != "ok" ]; do done echo ">> running integration tests against local cAdvisor" -godep go test github.com/google/cadvisor/integration/tests/... --vmodule=*=2 +go test github.com/google/cadvisor/integration/tests/... --vmodule=*=2 diff --git a/build/jenkins_e2e.sh b/build/jenkins_e2e.sh index 22c87754..7b39df21 100755 --- a/build/jenkins_e2e.sh +++ b/build/jenkins_e2e.sh @@ -22,9 +22,8 @@ BUILDER=${BUILDER:-false} # Whether this is running a PR builder job. export GO_FLAGS="-race" export GORACE="halt_on_error=1" -go get -u github.com/tools/godep ./build/presubmit.sh -godep go build -tags test github.com/google/cadvisor/integration/runner +go build -tags test github.com/google/cadvisor/integration/runner # Nodes that are currently stable. When tests fail on a specific node, and the failure is not remedied within a week, that node will be removed from this list. golden_nodes=( diff --git a/build/presubmit.sh b/build/presubmit.sh index d3b5eb25..53c38b3e 100755 --- a/build/presubmit.sh +++ b/build/presubmit.sh @@ -20,5 +20,5 @@ set -x ./build/check_gofmt.sh . ./build/check_boilerplate.sh go vet github.com/google/cadvisor/... -godep go test -v -race -test.short github.com/google/cadvisor/... -godep go build github.com/google/cadvisor +go test -v -race -test.short github.com/google/cadvisor/... +go build github.com/google/cadvisor diff --git a/deploy/build.sh b/deploy/build.sh index ef0a6f40..17f69fff 100755 --- a/deploy/build.sh +++ b/deploy/build.sh @@ -17,6 +17,6 @@ set -e set -x -godep go build -a github.com/google/cadvisor +make docker build -t google/cadvisor:beta . diff --git a/deploy/canary/Dockerfile b/deploy/canary/Dockerfile index af054ae1..2381aba1 100644 --- a/deploy/canary/Dockerfile +++ b/deploy/canary/Dockerfile @@ -3,8 +3,7 @@ MAINTAINER vmarmol@google.com RUN apt-get install -y git dmsetup RUN git clone https://github.com/google/cadvisor.git /go/src/github.com/google/cadvisor -RUN go get github.com/tools/godep -RUN cd /go/src/github.com/google/cadvisor && godep go build . +RUN cd /go/src/github.com/google/cadvisor && make ENTRYPOINT ["/go/src/github.com/google/cadvisor/cadvisor"] diff --git a/docs/development/build.md b/docs/development/build.md index ab5dd498..d9a94d19 100644 --- a/docs/development/build.md +++ b/docs/development/build.md @@ -14,24 +14,18 @@ After setting up Go, you should be able to `go get` cAdvisor as expected (we use $ go get -d github.com/google/cadvisor ``` -We use `godep` so you will need to get that as well: - -``` -$ go get github.com/tools/godep -``` - ## Building from Source At this point you can build cAdvisor from the source folder: ``` -$GOPATH/src/github.com/google/cadvisor $ godep go build . +$GOPATH/src/github.com/google/cadvisor $ make ``` or run only unit tests: ``` -$GOPATH/src/github.com/google/cadvisor $ godep go test ./... -test.short +$GOPATH/src/github.com/google/cadvisor $ make test ``` For integration tests, see the [integration testing](integration_testing.md) page. @@ -50,6 +44,6 @@ If you modify files in the /assets folder, you will need to rebuild the assets: ``` $GOPATH/src/github.com/google/cadvisor $ ./build/assets.sh -$GOPATH/src/github.com/google/cadvisor $ godep go build . +$GOPATH/src/github.com/google/cadvisor $ make ``` diff --git a/docs/development/integration_testing.md b/docs/development/integration_testing.md index e34fed92..4c42a010 100644 --- a/docs/development/integration_testing.md +++ b/docs/development/integration_testing.md @@ -3,7 +3,7 @@ The cAdvisor integration tests can be found in `integration/tests`. These run queries on a running cAdvisor. To run these tests: ``` -$ godep go run integration/runner/runner.go -port=PORT +$ go run integration/runner/runner.go -port=PORT ``` This will build a cAdvisor from the current repository and start it on the target machine before running the tests. @@ -11,7 +11,7 @@ This will build a cAdvisor from the current repository and start it on the targe To simply run the tests against an existing cAdvisor: ``` -$ godep go test github.com/google/cadvisor/integration/tests/... -host=HOST -port=PORT +$ go test github.com/google/cadvisor/integration/tests/... -host=HOST -port=PORT ``` Note that `HOST` and `PORT` default to `localhost` and `8080` respectively. diff --git a/integration/runner/run.sh b/integration/runner/run.sh index 9c6a17e5..eae451fd 100755 --- a/integration/runner/run.sh +++ b/integration/runner/run.sh @@ -30,7 +30,7 @@ if ! git diff --name-only origin/master | grep -c -E "*.go|*.sh" &> /dev/null; t fi # Build the runner. -godep go build github.com/google/cadvisor/integration/runner +go build github.com/google/cadvisor/integration/runner # Run it. HOSTS=$@ diff --git a/integration/runner/runner.go b/integration/runner/runner.go index 160df45d..bd57cbbe 100644 --- a/integration/runner/runner.go +++ b/integration/runner/runner.go @@ -37,7 +37,7 @@ import ( ) // must be able to ssh into hosts without password -// godep go run ./integration/runner/runner.go --logtostderr --v 2 --ssh-config <.ssh/config file> +// go run ./integration/runner/runner.go --logtostderr --v 2 --ssh-config <.ssh/config file> const ( cadvisorBinary = "cadvisor" @@ -180,7 +180,7 @@ func PushAndRunTests(host, testDir string) (result error) { } // Run the command - err = RunCommand("godep", "go", "test", "--timeout", testTimeout.String(), "github.com/google/cadvisor/integration/tests/...", "--host", host, "--port", portStr, "--ssh-options", *sshOptions) + err = RunCommand("go", "test", "--timeout", testTimeout.String(), "github.com/google/cadvisor/integration/tests/...", "--host", host, "--port", portStr, "--ssh-options", *sshOptions) if err == nil { // On success, break out of retry loop break diff --git a/vendor/github.com/abbot/go-http-auth/auth.go b/vendor/github.com/abbot/go-http-auth/auth.go index c4eb5639..e87ce6f0 100644 --- a/vendor/github.com/abbot/go-http-auth/auth.go +++ b/vendor/github.com/abbot/go-http-auth/auth.go @@ -2,12 +2,12 @@ package auth import "net/http" -/* +/* Request handlers must take AuthenticatedRequest instead of http.Request */ type AuthenticatedRequest struct { http.Request - /* + /* Authenticated user name. Current API implies that Username is never empty, which means that authentication is always done before calling the request handler. diff --git a/vendor/github.com/abbot/go-http-auth/digest.go b/vendor/github.com/abbot/go-http-auth/digest.go index b3225ee4..e52f9dfa 100644 --- a/vendor/github.com/abbot/go-http-auth/digest.go +++ b/vendor/github.com/abbot/go-http-auth/digest.go @@ -22,7 +22,7 @@ type DigestAuth struct { Secrets SecretProvider PlainTextSecrets bool - /* + /* Approximate size of Client's Cache. When actual number of tracked client nonces exceeds ClientCacheSize+ClientCacheTolerance, ClientCacheTolerance*2 @@ -108,7 +108,7 @@ func DigestAuthParams(r *http.Request) map[string]string { return result } -/* +/* Check if request contains valid authentication data. Returns a pair of username, authinfo where username is the name of the authenticated user or an empty string and authinfo is the contents for the optional @@ -178,7 +178,7 @@ func (da *DigestAuth) CheckAuth(r *http.Request) (username string, authinfo *str const DefaultClientCacheSize = 1000 const DefaultClientCacheTolerance = 100 -/* +/* Wrap returns an Authenticator which uses HTTP Digest authentication. Arguments: @@ -201,7 +201,7 @@ func (a *DigestAuth) Wrap(wrapped AuthenticatedHandlerFunc) http.HandlerFunc { } } -/* +/* JustCheck returns function which converts an http.HandlerFunc into a http.HandlerFunc which requires authentication. Username is passed as an extra X-Authenticated-Username header. diff --git a/vendor/github.com/abbot/go-http-auth/users.go b/vendor/github.com/abbot/go-http-auth/users.go index 5e7d0b8d..376a8ad6 100644 --- a/vendor/github.com/abbot/go-http-auth/users.go +++ b/vendor/github.com/abbot/go-http-auth/users.go @@ -3,7 +3,7 @@ package auth import "encoding/csv" import "os" -/* +/* SecretProvider is used by authenticators. Takes user name and realm as an argument, returns secret required for authentication (HA1 for digest authentication, properly encrypted password for basic). diff --git a/vendor/github.com/kr/text/wrap.go b/vendor/github.com/kr/text/wrap.go index ca885651..1c85cd2c 100755 --- a/vendor/github.com/kr/text/wrap.go +++ b/vendor/github.com/kr/text/wrap.go @@ -31,7 +31,7 @@ func WrapBytes(b []byte, lim int) []byte { // WrapWords is the low-level line-breaking algorithm, useful if you need more // control over the details of the text wrapping process. For most uses, either -// Wrap or WrapBytes will be sufficient and more convenient. +// Wrap or WrapBytes will be sufficient and more convenient. // // WrapWords splits a list of words into lines with minimal "raggedness", // treating each byte as one unit, accounting for spc units between adjacent diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 4974d8a8..775b9ee0 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -109,7 +109,7 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth callHdr := &transport.CallHdr{ Host: cc.authority, Method: method, - Flush: desc.ServerStreams&&desc.ClientStreams, + Flush: desc.ServerStreams && desc.ClientStreams, } if cc.dopts.cp != nil { callHdr.SendCompress = cc.dopts.cp.Type()