Commit Graph

41 Commits

Author SHA1 Message Date
c14d8be35a 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>
(cherry picked from commit feb70fd5c9e2fb3f300e953dd83053f0830f3895)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7b9ec00eec7ffe745ebd2f807daa50d84b3e10e7
Component: engine
2019-02-18 11:19:49 +01:00
9eb15371b3 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>
(cherry picked from commit 2a08f33166247da9d4c09d4c6c72cbb8119bf8df)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 748f37022df465c39a76461c4970f4c678f629e3
Component: engine
2019-02-18 11:19:23 +01:00
1cb0dc30a7 Fix swagger volume type generation
This was broken by bf6a790f00ab96bb8857e3c73502909ee5e36217

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b16b125bb4326e2eec9948fd54ca8c5d83eba36a
Component: engine
2018-05-14 13:46:20 -04:00
51b800faf9 Merge pull request #36193 from dnephin/debug-swagger-gen-failures
Make it easier to debug swagger-gen flakes
Upstream-commit: 39fe5875407bd23a8da25951d7343c66e0cc4482
Component: engine
2018-02-02 19:54:30 -08:00
1ccbec4ecc 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>
Upstream-commit: d80f25d079b84d8aa1e3233464c415e3b5d4480a
Component: engine
2018-02-02 11:07:40 -08:00
9256f1dbc3 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>
Upstream-commit: 075fd7a9bee630f62f0fa0d7a0a26c660ed504ea
Component: engine
2018-02-02 10:49:57 -08:00
cd6c81a6fb 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: b96093fa56a9 ("gometalinter: add per-platform configurable options")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c11508a5f405084da13c35ee7ab62f1670e4da39
Component: engine
2018-01-16 14:37:11 -08:00
3303de2b82 Merge pull request #34759 from kolyshkin/gometalinter
Gometalinter fixups for non-x86
Upstream-commit: 65e88d996ad13ad5ca9c2d2c625a87f9271d1e82
Component: engine
2017-09-18 13:44:15 -07:00
57c34191f2 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>
Upstream-commit: b96093fa56a9c085cb3123010be2430753c40cbc
Component: engine
2017-09-12 18:45:34 -07:00
18c29c5c5f Add gosimple linter
Update gometalinter

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

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 09652bf8789142a5a5a1de2d41590300761b4954
Component: engine
2017-09-08 18:23:21 -04:00
7ecd17f5d0 Fix lint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d0dbf8e397afe0365be59f98e5f52bb4d8d3f4e5
Component: engine
2017-09-01 15:12:22 -04:00
01392057b0 Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2f5f0af3fdb7e9ee607a0e178dbe2af6e10cccf4
Component: engine
2017-08-24 15:08:31 -04:00
157456237a Add interfacer linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 709bf8b7bcc67f3ea3a7a39e29af8ae16a38b06f
Component: engine
2017-08-24 15:08:26 -04:00
94c685a721 Add deadcode linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 62c1f0ef41e6cd88a8846da1c11976a320ca8b41
Component: engine
2017-08-21 18:18:50 -04:00
6b3b192846 Add goimports to linters.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 372670b5074b077927314cdf46af30f8752e7db0
Component: engine
2017-08-21 18:15:08 -04:00
0f9c6d96f0 Merge pull request #34551 from dnephin/use-gometalinter
Use gometalinter for linting
Upstream-commit: 4c8cde597daf3d96f74d3b6c4ff3a23e51f8abd3
Component: engine
2017-08-19 09:40:47 -07:00
3995851d84 Add a validation for integration-cli deprecation.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 89c0c5feb28c01dfc4e026b98107ca07c8d6c956
Component: engine
2017-08-18 14:24:32 -04:00
de626e10fb Fix golint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9b47b7b1519c5f2138e2933fb1fc459eb00895c0
Component: engine
2017-08-18 14:23:44 -04:00
63a6b47bce Use gometalinter for linting
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d7e2c4ce773b3a54f47e84a5a1ef22eb72c978b5
Component: engine
2017-08-18 14:23:43 -04:00
e529bcd027 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>
Upstream-commit: 5c3d2d552b0430672d5f481ab2d37036f6e92166
Component: engine
2017-06-22 11:52:35 -07:00
6dc61813df Remove bindata
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 96e61f3173c21a94f06db2bf1f8a6041da3e4e21
Component: engine
2017-06-21 11:20:05 -04:00
4999ae4553 Remove compose-bindata script, it should move to docker/cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 47cceb7f2c475e1798e8f339dfd4ad988eeaef42
Component: engine
2017-05-09 10:38:36 -04:00
276ea6a456 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>
Upstream-commit: 27bd6842f8518780b99fdb42f8e7f84c17856d87
Component: engine
2017-04-10 13:17:20 -04:00
55df7adcd9 Add compose-bindata validation to default.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 18e0a327ca59a6d4d9cb22f309f94b032a7e3b31
Component: engine
2017-03-08 10:23:40 -05:00
2bfb0e38ba add -ce support
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit 44aec1b69261e8cee0dd416adbbe7a2443f759d6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 98b7c4b00a9908e2ca46bcc134bcf38ac166509a
Component: engine
2017-03-06 16:33:20 +01:00
dccc4da522 hack/validate/vendor: add more checks
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 051b9a434f794ed67b5bfaf9dc9c4b0e6c46dd37
Component: engine
2017-02-16 07:43:03 +00:00
ec2663feb9 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>
Upstream-commit: 52379fa76dee07ca038624d639d9e14f4fb719ff
Component: engine
2017-02-13 11:01:54 -08:00
d3601c28f5 validate changelog dates are in descending order
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: 6cca6bf9429e21dc03086a5650e23879cf334a49
Component: engine
2017-01-23 19:19:35 -08:00
22c718e439 Update Compose schema to match docker-compose.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: de1ffebf19595e061c85727a4c34ac02ad4e934d
Component: engine
2017-01-20 12:36:57 -05:00
55c8f05f0d Add validation for compose schema bindata.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 38d08b0bd1a8aa931cefd9caf837dbc9a4bb0a37
Component: engine
2016-12-28 14:45:44 -05:00
edfbbc6ec9 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>
Upstream-commit: f5af9b9738892b5988f987ce5fbce6e31a10e768
Component: engine
2016-12-27 16:17:24 -05:00
42fb04bb4f validate changelog format
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Upstream-commit: aec52767b99a44afed5c9c132f88a6a41464d2e0
Component: engine
2016-12-07 22:30:56 -08:00
d5e6a04752 Fix swagger-gen validation.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f247a99c6ddcaa8448d339b84ae1a029a3048a77
Component: engine
2016-12-02 12:11:35 -05:00
c21adc5da9 Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 83ca993c154d56e03d6f95a3f8351c48b3ed3e29
Component: engine
2016-11-21 13:11:40 -08:00
6038277781 skip api/types/container/ (like golint) and fix one pkg
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 79a891efb7365e4f7d129a0142e66d2852781608
Component: engine
2016-11-18 16:33:50 -08:00
1a735f0856 Add validate/swagger-gen
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: be807639b0bf0d8589f4566896b3eb4114724b37
Component: engine
2016-11-09 14:44:16 -05:00
5a7cb6c536 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>
Upstream-commit: 5c4abd107a4e50b9f2d29f98275a5b5b86c5f50f
Component: engine
2016-11-07 11:03:21 -08:00
c5466cbef3 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>
Upstream-commit: efa7068133f224386dbcceb19a6dd31d1d2e9404
Component: engine
2016-11-03 19:08:24 -07:00
61646d77af project: use vndr for vendoring
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: f2614f2107c838d014d31b806e3b8a9f1395cb2b
Component: engine
2016-11-03 15:31:46 -07:00
dd0403a2eb 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>
Upstream-commit: 22033e10034884734621f185b60ddaa119014480
Component: engine
2016-11-03 14:24:22 -06:00