Commit graph

136 commits

Author SHA1 Message Date
Sebastiaan van Stijn
d3c0261876
hack/validate/deprecate-integration-cli: add integration-cli/*_api_*.go
The intent of this check is to not add integration tests that use the
CLI to test API functionality, so check for changes in "API" tests as
well, now that the `integration/` suite has matured enough to develop
new tests, or migrate existing ones.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-19 18:07:12 +01:00
Sebastiaan van Stijn
1f0fdcc6f5
hack/validate: clean-up output, move golang-ci-lint to end
The golang-ci-lint takes longest to run, so do the other
checks first; this also makes the output a bit more readable.

While at it, fix some consistency issues in the output of the
other checks.

Before this change:

    TEST_FORCE_VALIDATE=1 hack/validate/default
    Congratulations!  All commits are properly signed with the DCO!
    Congratulations! Seccomp profile generation is done correctly.
    INFO [config_reader] Used config file hack/validate/golangci-lint.yml
    INFO [lintersdb] Active 15 linters: [deadcode gofmt goimports golint gosec gosimple govet ineffassign misspell staticcheck structcheck typecheck unconvert unused varcheck]
    ...
    INFO Execution took 2m12.4287302s
    Congratulations!  "./pkg/..." is safely isolated from internal code.
    The swagger spec at "api/swagger.yaml" is valid against swagger specification 2.0
    Congratulations! All api changes are done the right way.
    Congratulations!  All toml source files changed here have valid syntax.
    Congratulations!  Changelog CHANGELOG.md is well-formed.
    Congratulations!  Changelog CHANGELOG.md dates are in descending order.

After this change:

    TEST_FORCE_VALIDATE=1 hack/validate/default
    Congratulations!  All commits are properly signed with the DCO!
    Congratulations!  Seccomp profile generation is done correctly.
    Congratulations!  Packages in "./pkg/..." are safely isolated from internal code.
    Congratulations!  The swagger spec at "api/swagger.yaml" is valid against swagger specification 2.0
    Congratulations!  All API changes are done the right way.
    Congratulations!  All TOML source files changed here have valid syntax.
    Congratulations!  Changelog CHANGELOG.md is well-formed.
    Congratulations!  Changelog CHANGELOG.md dates are in descending order.
    Congratulations!  No new tests were added to integration-cli.

    INFO Start validation with golang-ci-lint
    INFO [config_reader] Used config file hack/validate/golangci-lint.yml
    INFO [lintersdb] Active 15 linters: [deadcode gofmt goimports golint gosec gosimple govet ineffassign misspell staticcheck structcheck typecheck unconvert unused varcheck]
    ...
    INFO Execution took 2m12.4287302s

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-19 18:07:07 +01:00
Sebastiaan van Stijn
545e81714b
hack/validate: allow forcing validation
This introduces a FORCE_VALIDATE environment variable, which allows
forcing some validation steps, even if no changes were detected.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-19 18:03:55 +01:00
Sebastiaan van Stijn
9dde8f2b46
hack/validate/deprecate-integration-cli: don't exit on success
The `hack/validate/deprecate-integration-cli` script exited on
success. As a result, validation steps to run afterwards would
not be executed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-19 17:59:23 +01:00
Sebastiaan van Stijn
e21019fa51
hack/validate/default: fix minor linting issue
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-19 17:58:03 +01:00
Sebastiaan van Stijn
c8ecedbde9
Revert "hack: temporarily disable deprecate-integration-cli"
This reverts commit 5f67568bfd.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-19 17:57:56 +01:00
Akihiro Suda
8b8c01dd87
Merge pull request #40074 from yedamao/fix-integration-cli
integration-cli: Fix `SA1019: httputil.ClientConn is deprecated`
2019-12-19 03:30:34 +09:00
Sebastiaan van Stijn
e9bd017b68
Merge pull request #40148 from kolyshkin/vendor-diff
hack/validate/vendor: print diff for modified files
2019-11-07 12:42:03 -08:00
Brian Goff
47c5c67ed8
Merge pull request #40032 from jmartin84/fix-grpc-withdialer-deprecation-warning
Fix grpc withdialer deprecation warning
2019-11-05 12:20:33 -08:00
Kir Kolyshkin
5791019028 hack/validate/vendor: simplify looking for license
It was suggested that we use '.*\(COPYING\|LICENSE\|COPYRIGHT\).*'
as an argument to `find -iregex`, and this is how it all started.

Next thing, there is no COPYRIGHT in any of the vendored packages,
so it can be removed for good.

Next, we should not look too deep inside the package directory, as
the license should be in its root directory, so add `-maxdepth 1`
to `find`. This should also speed things up.

Finally, since we're not using the recursion feature of `find`,
it can be replaced with `echo | grep`.

While at it,
* avoid temporary $pkgs variable as it is only used once;
* replace `ls -d "vendor/$f"  > /dev/null 2>&1` with `test -d`.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-10-29 10:59:05 -07:00
Kir Kolyshkin
4be12ad3d0 hack/validate/vendor: shellcheck fixes
The export statement is definitely not needed. The rest is obvious.

> In hack/validate/vendor line 3:
> export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
>        ^-- SC2155: Declare and assign separately to avoid masking return values.
>
>
> In hack/validate/vendor line 43:
>	if ls -d vendor/$f  > /dev/null 2>&1; then
>                       ^-- SC2086: Double quote to prevent globbing and word splitting.
>
>
> In hack/validate/vendor line 44:
> 		found=$(find vendor/$f -iregex '.*LICENSE.*' -or -iregex '.*COPYRIGHT.*' -or -iregex '.*COPYING.*' | wc -l)
>                                   ^-- SC2086: Double quote to prevent globbing and word splitting.
>
>
> In hack/validate/vendor line 45:
>		if [ $found -eq 0 ]; then
>                    ^-- SC2086: Double quote to prevent globbing and word splitting.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-10-28 19:27:55 -07:00
Kir Kolyshkin
9d4e81e8bf hack/validate/vendor: print diff for modified files
In case some files were modified (rather than merely added
or removed), we're curious to see the diff for those.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-10-28 19:22:28 -07:00
HuanHuan Ye
203ba72fc5 integration-cli: Fix SA1019: httputil.ClientConn is deprecated
Rewrite sockRequestHijack to requestHijack which use writable
Transport's Response.Body to replace deprecated hijacked httputil.ClientConn.
```
// As of Go 1.12, the Body will also implement io.Writer
// on a successful "101 Switching Protocols" response,
// as used by WebSockets and HTTP/2's "h2c" mode.
Body io.ReadCloser
```.

TestPostContainersAttach and TestExecResizeImmediatelyAfterExecStart
replace all sockRequestHijack to requestHijack.

Signed-off-by: HuanHuan Ye <logindaveye@gmail.com>
2019-10-22 10:55:29 +08:00
Sebastiaan van Stijn
9cb9c6eba4
bump golangci-lint v1.20.0
release notes:

- v1.20.0: https://github.com/golangci/golangci-lint/releases/tag/v1.20.0
    - Add WSL linter (#771)
    - Add gocognit linter (#756)
    - govet: add more analyzers
    - dramatically reduce memory usage
    - reduce 1.5x memory usage on large repos on repeated runs
    - Rename deadline option to timeout and mark deadline as deprecated
- v1.19.1: https://github.com/golangci/golangci-lint/releases/tag/v1.19.1
- v1.19.0: https://github.com/golangci/golangci-lint/releases/tag/v1.19.0
    - Add dogsled linter.
    - Add whitespace linter
    - Add Godox linter support
    - Various performance optimizations
- v1.18.0: https://github.com/golangci/golangci-lint/releases/tag/v1.18.0
    - Support go1.13
    - Update format of junit xml output to mark failures as such
    - Speed up linting: use deduplicated packages
    - Add user supplied error messages in depguard issues
    - Add funlen linter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-18 00:46:15 +02:00
Sebastiaan van Stijn
a06d7f5a3e
golangci-lint: include all enabled linters in config
This makes it clearer from the configuration what linters
are enabled.

Also disables the `gofmt` linter, because it's superseded
by the `goimports` linter.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-18 00:46:13 +02:00
Sebastiaan van Stijn
086b4541cf
golangci-lint: disable default exclusion rules
The default exclusion rules were too permissive; disable
them, but copy the relevant ones to the configuation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-18 00:46:11 +02:00
Sebastiaan van Stijn
fe3c14d5ba
golangci-lint: fix "golint" not ignoring generated files
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-18 00:46:08 +02:00
Sebastiaan van Stijn
47502344b9
golangci-lint: update exclusion rules for todo's
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-18 00:46:04 +02:00
Justen Martin
3b49bd1d84
replaced call to deprecated grpc method WithDialer with WithContextDialer
Signed-off-by: Justen Martin <jmart@the-coder.com>
2019-10-10 15:34:42 -05:00
Akihiro Suda
1dd9260e47
Merge pull request #39956 from jmartin84/fix-closenotifier-deprecation-warning
Removed deprecated CloseNotifier logic
2019-09-24 02:37:15 +09:00
Sebastiaan van Stijn
6c3113e599
Merge pull request #39951 from yedamao/fix-base-Dial-is-deprecated
Fix base.Dial is deprecated: Use DialContext instead
2019-09-21 13:01:40 +02:00
HuanHuan Ye
a57fd5488d Fix base.Dial is deprecated: Use DialContext instead
1.Change base.Dial to base.DailContext.
2.Remove proxyDialer that was previously used to configure a
net.Dialer to route proxy.Dialer which will route the connections
through the proxy using the connections through a SOCKS proxy.
SOCKS proxies are now supported by configuring only http.Transport.Proxy,
and no longer require changing http.Transport.Dial.

Signed-off-by: HuanHuan Ye <logindaveye@gmail.com>
2019-09-20 10:42:13 +08:00
Sebastiaan van Stijn
851b000641
integration-cli: enable golangci-lint
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-19 10:50:31 +02:00
Justen Martin
23ab331979 Removed deprecated CloseNotifier logic
Signed-off-by: Justen Martin <jmart@the-coder.com>
2019-09-18 16:14:30 -05:00
Sebastiaan van Stijn
5f67568bfd
Revert "Revert "hack: temporarily disable deprecate-integration-cli""
This reverts commit 01332b54e0.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:58:02 +02:00
Sebastiaan van Stijn
6f0dfe44eb
golangci-lint: suppress remaining deprecation errors for now (staticcheck)
```
distribution/registry.go:84:3: SA1019: base.Dial is deprecated: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority.  (staticcheck)
registry/registry.go:188:3:    SA1019: base.Dial is deprecated: Use DialContext instead, which allows the transport to cancel dials as soon as they are no longer needed. If both are set, DialContext takes priority.  (staticcheck)

client/hijack.go:85:16:                               SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead.  (staticcheck)
integration-cli/docker_api_attach_test.go:245:12:     SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead.  (staticcheck)
integration/plugin/authz/authz_plugin_test.go:180:7:  SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead.  (staticcheck)
integration/plugin/authz/authz_plugin_test.go:479:12: SA1019: httputil.NewClientConn is deprecated: Use the Client or Transport in package net/http instead.  (staticcheck)

integration-cli/docker_api_attach_test.go:239:134:    SA1019: httputil.ClientConn is deprecated: Use Client or Transport in package net/http instead.  (staticcheck)

daemon/daemon.go:885:3:                               SA1019: grpc.WithDialer is deprecated: use WithContextDialer instead.  Will be supported throughout 1.x.  (staticcheck)

pkg/authorization/response.go:18:2:                   SA1019: http.CloseNotifier is deprecated: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead.  (staticcheck)
pkg/authorization/response.go:160:30:                 SA1019: http.CloseNotifier is deprecated: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead.  (staticcheck)
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:58:01 +02:00
Sebastiaan van Stijn
df7d719e4c
golangci-lint: suppress Xattrs is deprecated: Use PAXRecords instead
```
pkg/archive/archive.go:407:3:       SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead.  (staticcheck)
pkg/archive/archive.go:408:3:       SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead.  (staticcheck)
pkg/archive/archive.go:661:26:      SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead.  (staticcheck)
pkg/archive/archive_linux.go:47:7:  SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead.  (staticcheck)
pkg/archive/archive_linux.go:48:12: SA1019: hdr.Xattrs is deprecated: Use PAXRecords instead.  (staticcheck)
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:58:00 +02:00
Sebastiaan van Stijn
f41712c4be
golangci-lint: enable misspell, tweak configuration
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:57:59 +02:00
Sebastiaan van Stijn
c9553897f3
golangci-lint: enable gosec linter
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:57:58 +02:00
Sebastiaan van Stijn
d1363f5a90
golangci-lint: set correct build-tags to lint journald if supported
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:57:58 +02:00
Sebastiaan van Stijn
85b89c9e50
Replace gometalinter with golangci-lint
Replacing gometalinter, because it has been deprecated,
and the repository was archived.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:57:57 +02:00
Sebastiaan van Stijn
a464a3d51f
Dockerfile: remove GOMETALINTER_OPTS
This `ENV` was added to the Dockerfile in b96093fa56,
when the repository used per-architecture Dockerfiles, and some architectures needed
a different configuration.

Now that we use a multi-arch Dockerfile, and CI uses a Jenkinsfile, we can remove
this `ENV` from the Dockerfile, and set it in CI instead if needed.

Also updated the wording and fixed linting issues in hack/validate/gometalinter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-11 08:58:38 +02:00
Sebastiaan van Stijn
01332b54e0
Revert "hack: temporarily disable deprecate-integration-cli"
This reverts commit beadc92e07.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-10 23:01:46 +02:00
Tibor Vass
beadc92e07 hack: temporarily disable deprecate-integration-cli
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-09 21:09:57 +00:00
Tibor Vass
7cd028f2d0 hack: update scripts
- remove -check.* flags
- use (per-test) -timeout flag
- allow user to override TEST_SKIP_* regardless of TESTFLAGS
- remove test-imports validation

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-09 21:09:57 +00:00
Sebastiaan van Stijn
b5e5cac0f5
Set locale to fix yamlllint
Attempting to fix;

```
21:16:00 Traceback (most recent call last):
21:16:00 File "/usr/local/bin/yamllint", line 11, in <module>
21:16:00 sys.exit(run())
21:16:00 File "/usr/local/lib/python3.5/dist-packages/yamllint/cli.py", line 170, in run
21:16:00 problems = linter.run(f, conf, filepath)
21:16:00 File "/usr/local/lib/python3.5/dist-packages/yamllint/linter.py", line 233, in run
21:16:00 content = input.read()
21:16:00 File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
21:16:00 return codecs.ascii_decode(input, self.errors)[0]
21:16:00 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 123522: ordinal not in range(128)
21:16:00 Build step 'Execute shell' marked build as failure
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-06 01:35:35 +02:00
Sebastiaan van Stijn
2cffe9be3d
hack: fix mixed tabs/spaces for indentation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-02 15:58:33 +02:00
Tibor Vass
a9026e0e3f Revert "validate: temporarily disable deprecate-integration-cli as part of a revert"
This reverts commit 3f1cdd5364.

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-06-19 00:54:14 +00:00
Tibor Vass
3f1cdd5364 validate: temporarily disable deprecate-integration-cli as part of a revert
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-06-18 01:40:25 +00:00
Aleksa Sarai
d283c7fa2b
*: remove interfacer linter from CI
It has been declared deprecated by the author, and has a knack for
false-positives (as well as giving bad advice when it comes to APIs --
which is quite clear when looking at "nolint: interfacer" comments).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2019-03-13 11:48:39 +11:00
Tibor Vass
feb70fd5c9 hack: no need to git fetch in CI
CIs are assumed to do a git fetch and git merge before running tests.
Therefore, no need for a git fetch inside our validate scripts in CI.

If VALIDATE_ORIGIN_BRANCH is set, then git fetch is skipped and
VALIDATE_ORIGIN_BRANCH is used in validate scripts.

Otherwise, behavior is unchanged.

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-02-05 02:54:50 +00:00
Sebastiaan van Stijn
2a08f33166
Allow overriding repository and branch in validate scripts
When running CI in other repositories (e.g. Docker's downstream
docker/engine repository), or other branches, the validation
scripts were calculating the list of changes based on the wrong
information.

This lead to weird failures in CI in a branch where these values
were not updated ':-) (CI on a pull request failed because it detected
that new tests were added to the deprecated `integration-cli` test-suite,
but the pull request did not actually make changes in that area).

This patch allows overriding the target repository (and branch)
to compare to (without having to edit the scripts).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-31 01:23:42 +01:00
Sebastiaan van Stijn
37498f009d
Shell scripts: fix bare variables
This makes my IDE a bit more silent :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-10 02:50:47 +01:00
Sebastiaan van Stijn
c3650770cc
Revert "Bash scripts; use double brackets, fix bare variables, add quotes"
This reverts commit 297b30df5f.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-10 02:23:38 +01:00
Sebastiaan van Stijn
297b30df5f
Bash scripts; use double brackets, fix bare variables, add quotes
These scripts explicitly use Bash, so we should be able to use
`[[` instead of `[` (which seems to be recommended).

Also added curly brackets to some bare variables, and quoted some paths.

This makes my IDE a bit more silent :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-24 00:05:14 +01:00
Kir Kolyshkin
ce858feb6a Bump vndr
We can do that now as we're no longer carrying archive/tar.
Note that latest vndr removes vendor/ subdir so we don't have to,
thus the change in hack/validate/vendor.

While at it, re-run a new vndr version to make sure everything
that should be there is.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-06 15:24:48 -07:00
Kir Kolyshkin
10fd0516b9 Bump golang to 1.11.0
It's that time of year again! Go 1.11 is released, time to use it.

This commit also

* removes our archive/tar fork, since upstream archive/tar
  is fixed for static builds, and osusergo build tag is set.

* removes ENV GO_VERSION from Dockerfile as it's not needed
  anymore since PR #37592 is merged.

[v2: switch to beta2]
[v3: switch to beta3]
[v4: rc1]
[v5: remove ENV GO_VERSION as PR #37592 is now merged]
[v6: rc2]
[v7: final!]
[v8: use 1.11.0]
[v9: back to 1.11]
[v8: use 1.11.0]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-06 15:24:44 -07:00
Brian Goff
b16b125bb4 Fix swagger volume type generation
This was broken by bf6a790f00

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-14 13:46:20 -04:00
Yong Tang
39fe587540
Merge pull request #36193 from dnephin/debug-swagger-gen-failures
Make it easier to debug swagger-gen flakes
2018-02-02 19:54:30 -08:00
Daniel Nephin
d80f25d079 Make it easier to debug swgger-gen flakes
Sometimes this check fails, but git status doesn't give us enough information
to debug the failure.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2018-02-02 11:07:40 -08:00
Daniel Nephin
075fd7a9be Fix vendor validation
Previously adding files to vendor/ without adding to vendor.conf would not fail the
validation.

Also be consistent with indentation and use tabs.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2018-02-02 10:49:57 -08:00
Kir Kolyshkin
c11508a5f4 gometalinter: fix --deadline option
1. Add = between the option and the argument, otherwise the argument
   appears to be passed on to the linters directly, as in:

> DEBUG: [golint.8]: executing /home/kir/go/bin/golint
> -min_confidence 0.800000 ./10m ./api ./api/errdefs <...>

2. Fix setting the default for GOMETALINTER_OPTS -- the default
   was -deadline (rather than --deadline).

Fixes: b96093fa56 ("gometalinter: add per-platform configurable options")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-01-16 14:37:11 -08:00
Yong Tang
65e88d996a Merge pull request #34759 from kolyshkin/gometalinter
Gometalinter fixups for non-x86
2017-09-18 13:44:15 -07:00
Kir Kolyshkin
b96093fa56 gometalinter: add per-platform configurable options
I have run into two separate issues while doing 'make all' on armhf
(a Scaleway C1 machine, same as used in CI). This commit fixes both.

1. There were a lot of "not enough memory" errors, and after that
in a few runs gometalinter just stuck forever on FUTEX_WAIT with
no children left.

Looking into docs, I found the --enable-gc option which solved the issue.

[Update: this has already been added]

2. Timeout of 2 minutes is not enough for the abovementioned platform.
The longest running linter is goimports which takes almost 6 minutes to run.

Set the timeout to the observable run time roughly doubled.

In addition, ARM platforms does not have too much RAM (2GB), so
running too many processes in parallel might be problematic. Limit
it by using -j2

[v2: make the timeout arch-dependent, also tested on aarch64 (2m15s)]
[v3: moved timeout setting to Dockerfiles]
[v4: generalized to GOMETALINTER_OPTS, added -j2 for ARM platforms]
[v5: rebase to master]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-09-12 18:45:34 -07:00
Daniel Nephin
f7f101d57e Add gosimple linter
Update gometalinter

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-12 12:09:59 -04:00
Daniel Nephin
09652bf878 Add ineffassign linter
Also enable GC in linting to reduce memory usage.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-08 18:23:21 -04:00
Daniel Nephin
d0dbf8e397 Fix lint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-01 15:12:22 -04:00
Daniel Nephin
2f5f0af3fd Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-24 15:08:31 -04:00
Daniel Nephin
709bf8b7bc Add interfacer linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-24 15:08:26 -04:00
Daniel Nephin
62c1f0ef41 Add deadcode linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-21 18:18:50 -04:00
Daniel Nephin
372670b507 Add goimports to linters.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-21 18:15:08 -04:00
Yong Tang
4c8cde597d Merge pull request #34551 from dnephin/use-gometalinter
Use gometalinter for linting
2017-08-19 09:40:47 -07:00
Daniel Nephin
89c0c5feb2 Add a validation for integration-cli deprecation.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-18 14:24:32 -04:00
Daniel Nephin
9b47b7b151 Fix golint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-18 14:23:44 -04:00
Daniel Nephin
d7e2c4ce77 Use gometalinter for linting
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-18 14:23:43 -04:00
Tonis Tiigi
5c3d2d552b Implement incremental file sync using client session
Also exposes shared cache and garbage collection/prune
for the source data.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-06-22 11:52:35 -07:00
Daniel Nephin
96e61f3173 Remove bindata
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-21 11:20:05 -04:00
Daniel Nephin
47cceb7f2c Remove compose-bindata script, it should move to docker/cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-05-09 10:38:36 -04:00
Brian Goff
27bd6842f8 Implement plugins for logging drivers
Logging plugins use the same HTTP interface as other plugins for basic
command operations meanwhile actual logging operations are handled (on
Unix) via a fifo.

The plugin interface looks like so:

```go
type loggingPlugin interface {
  StartLogging(fifoPath string, loggingContext Context) error
  StopLogging(fifoPath)
```

This means a plugin must implement `LoggingDriver.StartLogging` and
`LoggingDriver.StopLogging` endpoints and be able to consume the passed
in fifo.

Logs are sent via stream encoder to the fifo encoded with protobuf.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-04-10 13:17:20 -04:00
Daniel Nephin
18e0a327ca Add compose-bindata validation to default.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-08 10:23:40 -05:00
Victor Vieux
98b7c4b00a
add -ce support
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 44aec1b692)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-03-06 16:33:20 +01:00
Akihiro Suda
051b9a434f hack/validate/vendor: add more checks
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-02-16 07:43:03 +00:00
Tianon Gravi
52379fa76d Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2017-02-13 11:01:54 -08:00
Andrew Hsu
6cca6bf942 validate changelog dates are in descending order
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-01-23 19:19:35 -08:00
Daniel Nephin
de1ffebf19 Update Compose schema to match docker-compose.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-01-20 12:36:57 -05:00
Daniel Nephin
38d08b0bd1 Add validation for compose schema bindata.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-28 14:45:44 -05:00
Daniel Nephin
f5af9b9738 Replace vendor of aanand/compose-file with a local copy.
Add go-bindata for including the schema.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-27 16:17:24 -05:00
Andrew Hsu
aec52767b9 validate changelog format
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2016-12-07 22:30:56 -08:00
Daniel Nephin
f247a99c6d Fix swagger-gen validation.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-12-02 12:11:35 -05:00
Anusha Ragunathan
83ca993c15 Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-21 13:11:40 -08:00
Victor Vieux
79a891efb7 skip api/types/container/ (like golint) and fix one pkg
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2016-11-18 16:33:50 -08:00
Daniel Nephin
be807639b0 Add validate/swagger-gen
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-09 14:44:16 -05:00
Ben Firshman
5c4abd107a
Add swagger.yaml validation
- yamllint to ensure it is a valid YAML file
- go-swagger validate to ensure it is a valid swagger file

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2016-11-07 11:03:21 -08:00
Aaron Lehmann
efa7068133 Run lint on most of api/types
The validate-lint script excludes any package names that match
api/types. However, the only subpackage that appears to cause issues is
api/types/container (due to stuttering names). Tighten the filtering so
that other code inside api/types is validated.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-03 19:08:24 -07:00
Alexander Morozov
f2614f2107 project: use vndr for vendoring
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-11-03 15:31:46 -07:00
Daniel Nephin
22033e1003 Move validation out of hack/make
Allow each script to run directly without the hack/make.sh wrapper. These
scripts do not produce artifacts and do not benefit from the "bundles"
framework.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-11-03 14:24:22 -06:00