Commit Graph

3002 Commits

Author SHA1 Message Date
4262667057 Merge pull request #34985 from thaJeztah/remove-use-of-deprecated-filter-functions
Remove use of deprecated filter functions
Upstream-commit: a343cba40c25deb2893e13f9a81dbcc4d19d16e2
Component: engine
2017-09-27 17:34:07 +02:00
2a54e5d16e add node/service/secret/config specific event filter
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
Upstream-commit: 4611ecd3cdc9b2738f58a136b79f752add223f3f
Component: engine
2017-09-27 00:23:51 +08:00
e3c3856028 Merge pull request #34908 from thaJeztah/bump-api-version-1.33
Bump API version to 1.33
Upstream-commit: 74a084162ce544fe995715ba47aa84d3d75b95c1
Component: engine
2017-09-26 18:09:50 +02:00
5dbfedf3f9 Replace uses of filters.ToParam(), FromParam() with filters.ToJSON(), FromJSON()
`filters.ToParam()` and `filters.FromParam()` were deprecated in favor of
`filters.ToJSON()` and `filters.FromJSON()` in 065118390a3ecaf0dbd2fa752d54d43f8f1e8ec6,
but still used in various locations.

This patch replaces uses of `filters.ToParam()` and  `filters.FromParam()` with
`filters.ToJSON()` and `filters.FromJSON()`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a4efe66cf2a7648dbcf5b9993bf351925b905b5b
Component: engine
2017-09-26 13:59:45 +02:00
c4c68bf819 Replace uses of filters.Include() with filters.Contains()
The `filters.Include()` method was deprecated in favor of `filters.Contains()`
in 065118390a3ecaf0dbd2fa752d54d43f8f1e8ec6, but still used in various
locations.

This patch replaces uses of `filters.Include()` with `filters.Contains()`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 97c5ae25c4d857563acd1f3467afc760145b1d55
Component: engine
2017-09-26 13:39:56 +02:00
101f740d40 Move RFC3339NanoFixed to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 27cfa68af16721c978803c3b695bcc7181ccc721
Component: engine
2017-09-25 16:07:24 -04:00
e2fa4c4d55 Bump API version to 1.33
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 15a59e763b6bdb44f28ffafb20e173606308ce2c
Component: engine
2017-09-20 15:19:16 +02:00
cddfe04f6a LCOW: Implemented support for docker cp + build
This enables docker cp and ADD/COPY docker build support for LCOW.
Originally, the graphdriver.Get() interface returned a local path
to the container root filesystem. This does not work for LCOW, so
the Get() method now returns an interface that LCOW implements to
support copying to and from the container.

Signed-off-by: Akash Gupta <akagup@microsoft.com>
Upstream-commit: 7a7357dae1bcccb17e9b2d4c7c8f5c025fce56ca
Component: engine
2017-09-14 12:07:52 -07:00
803b5f0e94 Merge pull request #34821 from thaJeztah/remove-enable-api-cors
Remove deprecated --enable-api-cors flag
Upstream-commit: dc35a8a5d22b6c828cd105be7c62b72919df25cd
Component: engine
2017-09-13 20:10:27 -07:00
63f4bb52b4 Merge pull request #34828 from allencloud/add-config-tags-in-swagger
add configs tag in swagger.yml
Upstream-commit: 80edccda708c6771824c245b4d634c2a9ce29795
Component: engine
2017-09-14 02:37:28 +02:00
523435549c add configs tag in swagger.yml
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
Upstream-commit: 16929d337a5dbd9aaa029271db1cdba25dd0d2f2
Component: engine
2017-09-13 09:48:05 +08: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
3e4a18de4d Remove deprecated --enable-api-cors flag
The `--enable-api-cors` flag was deprecated in f3dd2db4ff7de1399a49af928cd3eae4fccf8764,
and marked for removal in docker 17.09 through 85f92ef3590b386ea17e3948262725a2d3ce4db5.

This patch removes the deprecated flag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7d4eab554379524c2421a7ecd3319d1d087d1de2
Component: engine
2017-09-12 12:43:34 +02:00
58743c32f5 Merge pull request #34756 from dnephin/better-filters
Improve docs and interface for api/types/filters
Upstream-commit: c8400bf24dcea8e160d6b614d996b0f659c7d8d9
Component: engine
2017-09-07 17:00:59 -04:00
d7504f67d1 Merge pull request #34738 from wgliang/optimization1
Optimize some wrong usage and spelling
Upstream-commit: 2dcb77b24c80dd95b52358c92436f68f2a33eb01
Component: engine
2017-09-07 09:45:14 -07:00
eec1d4ef54 Optimize some wrong usage and spelling
Signed-off-by: wgliang <liangcszzu@163.com>
Upstream-commit: 94cefa21459a0c620e5a9c2da04df6d3a43dae17
Component: engine
2017-09-07 09:44:08 +08:00
cb4257d5fb Cleanup filter package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 065118390a3ecaf0dbd2fa752d54d43f8f1e8ec6
Component: engine
2017-09-06 16:41:47 -04:00
cc7b3620f0 Remove libtrust dep from api
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2f007e46d0100d865a061c1a8e544bddc0b7a368
Component: engine
2017-09-06 12:05:19 -04:00
33519380e5 Move names to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 22b246417f52aa6bd0e358e41e2bfb9c0a59c867
Component: engine
2017-09-06 12:05:16 -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
8fc04bd8d4 Merge pull request #34588 from dnephin/more-linters
Add deadcode and goimports linters
Upstream-commit: 6540d5581473c292ade46ee1b620172441943f4b
Component: engine
2017-08-22 05:12:50 -07:00
7cc406aa10 Merge pull request #34572 from krizalys/hyphenless-bind-mount
Dropped hyphen in bind mount where appropriate
Upstream-commit: 28362f11d73b5b72ff9d7eba27cf9f817ec86ef8
Component: engine
2017-08-22 05:11:46 -07: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
3c66acc139 Dropped hyphen in bind mount where appropriate
Signed-off-by: Christophe Vidal <kriss@krizalys.com>
Upstream-commit: dffa5d6df2e51556edfbcebc4695fdbc0bcc1a90
Component: engine
2017-08-19 21:25:07 +07: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
9156c95e0a Merge pull request #34188 from cpuguy83/32144_api_error_handling
Remove string checking in API error handling
Upstream-commit: 2afb3efaa63537cc152437af3cd7a6743fcb3d8d
Component: engine
2017-08-16 08:53:15 -07:00
ee29bacf1d Create definition for SystemInfo response
The `/info` endpoint was badly documented, missing various
fields and incorrectly describing others.

This patch defines a type for the endpoint, based on the
API types in the source.

Also removing the response example in favor of
per-field examples, as this prevents an incorrectly
formatted response from masking omissions in the
actual type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 18b23067be82054a6384fc5934ecbb0276d1862b
Component: engine
2017-08-16 11:11:29 +02:00
81aceb39fb Remove redundant example for Node
All example values are now documented per field,
so are automatically used to generate responses.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 2720cefbb2eaac9f440cd7c1807b4222b18ee0c4
Component: engine
2017-08-16 11:11:19 +02:00
031f55b2f7 Add definition for Swarm inspect response
Also remove inline response examples

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5b017ef45d68748b8f4065db137aa55e1ff0e8ab
Component: engine
2017-08-16 11:11:14 +02:00
3a37403bb9 Extract NodeDescription to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 33e2c994015cbc8f7e86bc1b764e17a7470a17ac
Component: engine
2017-08-16 11:11:09 +02:00
54e785932e Extract EngineDescription to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7cb4a97ae195bce55b0a2e54e08b3cd1b4b190af
Component: engine
2017-08-16 11:11:04 +02:00
4645cfda21 Extract Platform to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a2de2681a65d034ffb231b15b630b5a053608331
Component: engine
2017-08-16 11:10:58 +02:00
d0c8aa84bd Add missing definition for Node.ManagerStatus
The `Node.ManagerStatus`  property was only present in
the example, but not in the definition.

This patch adds definitions for `ManagerStatus`
and `Reachability`, similar to what is used in the
code;
f02a5b50c4/api/types/swarm/node.go (L84-L101)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3f1ad79faf3bfecc19722eb6541bb415024dafe4
Component: engine
2017-08-16 11:10:53 +02:00
9fee66bce7 Add missing definition for Node.Status
The `Node.Status`  property was only present in
the example, but not in the definition.

This patch adds definitions for `NodeStatus`
and `NodeState`, similar to what is used in the
code;

- f02a5b50c4/api/types/swarm/node.go (L77-L82)
- f02a5b50c4/api/types/swarm/node.go (L103-L115)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 26b247e706e613af5214e4a89de375128f3368dd
Component: engine
2017-08-16 11:10:47 +02:00
6526a15536 Fix TLSInfo in Node specification
- `TLSInfo` is part of `Node.Description`, but was documented as a
  direct child of `Node`
- `Node.TLSInfo` incorrectly was using the `SwarmSpec` type,
  instead of `TLSInfo`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b2de157a41bbd18ca4317792614e8630d73a7102
Component: engine
2017-08-16 11:10:42 +02:00
d3b3ce345c Update incorrect types in Swagger
- `ObjectVersion.Index` is an `uint64` 0fd90c4d5d/api/types/swarm/common.go (L5-L15)
- `ClusterInfo` is nullable in the `/info` output (see ff4f700f74/api/types/swarm/swarm.go (L203))
- `CAConfig.ForceRotate` was missing a type, therefore treated as an `object` in Swagger: ff4f700f74/api/types/swarm/swarm.go (L121)
- `Raft.SnapshotInterval`, `Raft.KeepOldSnapshots`, and `Raft.LogEntriesForSlowFollowers` are an `uint64` not an `int64`
- Various fields in `swarm.Info` are nullable; added `x-nullable`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 93e324e2a7b8131414382b6fb38b69f0d09bc30c
Component: engine
2017-08-16 11:10:32 +02:00
da62e48708 Update / add extra description fields to Swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 934378bee3846b1f0b790d3ee185d161900cb953
Component: engine
2017-08-16 11:10:27 +02:00
d01174e4e5 Add extra example values to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fa05a53426da6183199a97071e3d60a6d41a39be
Component: engine
2017-08-16 11:10:22 +02:00
8a9c9ec9a9 Reformat definitions - add some whitespace
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f720f9cc33e1be12b767f5066511266d87a7673b
Component: engine
2017-08-16 11:10:14 +02:00
30f1b651e2 Remove string checking in API error handling
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.

Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ebcb7d6b406fe50ea9a237c73004d75884184c33
Component: engine
2017-08-15 16:01:11 -04:00
f6b9be5da8 Update NetworkConfig definition in Swagger
This patch updates the definition of `NetworkConfig` to match the code, and
renames to the definition to `NetworkSettings` (also to match the type in
the code).

Add definitions for:

- `Address`
- `PortMap`
- `PortBinding`
- `EndpointIPAMConfig`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b98ceb7121c5513c73d69081737ad824384c5391
Component: engine
2017-08-15 09:39:41 +02:00
eca24fb7b0 Implement none, private, and shareable ipc modes
Since the commit d88fe447df0e8 ("Add support for sharing /dev/shm/ and
/dev/mqueue between containers") container's /dev/shm is mounted on the
host first, then bind-mounted inside the container. This is done that
way in order to be able to share this container's IPC namespace
(and the /dev/shm mount point) with another container.

Unfortunately, this functionality breaks container checkpoint/restore
(even if IPC is not shared). Since /dev/shm is an external mount, its
contents is not saved by `criu checkpoint`, and so upon restore any
application that tries to access data under /dev/shm is severily
disappointed (which usually results in a fatal crash).

This commit solves the issue by introducing new IPC modes for containers
(in addition to 'host' and 'container:ID'). The new modes are:

 - 'shareable':	enables sharing this container's IPC with others
		(this used to be the implicit default);

 - 'private':	disables sharing this container's IPC.

In 'private' mode, container's /dev/shm is truly mounted inside the
container, without any bind-mounting from the host, which solves the
issue.

While at it, let's also implement 'none' mode. The motivation, as
eloquently put by Justin Cormack, is:

> I wondered a while back about having a none shm mode, as currently it is
> not possible to have a totally unwriteable container as there is always
> a /dev/shm writeable mount. It is a bit of a niche case (and clearly
> should never be allowed to be daemon default) but it would be trivial to
> add now so maybe we should...

...so here's yet yet another mode:

 - 'none':	no /dev/shm mount inside the container (though it still
		has its own private IPC namespace).

Now, to ultimately solve the abovementioned checkpoint/restore issue, we'd
need to make 'private' the default mode, but unfortunately it breaks the
backward compatibility. So, let's make the default container IPC mode
per-daemon configurable (with the built-in default set to 'shareable'
for now). The default can be changed either via a daemon CLI option
(--default-shm-mode) or a daemon.json configuration file parameter
of the same name.

Note one can only set either 'shareable' or 'private' IPC modes as a
daemon default (i.e. in this context 'host', 'container', or 'none'
do not make much sense).

Some other changes this patch introduces are:

1. A mount for /dev/shm is added to default OCI Linux spec.

2. IpcMode.Valid() is simplified to remove duplicated code that parsed
   'container:ID' form. Note the old version used to check that ID does
   not contain a semicolon -- this is no longer the case (tests are
   modified accordingly). The motivation is we should either do a
   proper check for container ID validity, or don't check it at all
   (since it is checked in other places anyway). I chose the latter.

3. IpcMode.Container() is modified to not return container ID if the
   mode value does not start with "container:", unifying the check to
   be the same as in IpcMode.IsContainer().

3. IPC mode unit tests (runconfig/hostconfig_test.go) are modified
   to add checks for newly added values.

[v2: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-51345997]
[v3: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-53902833]
[v4: addressed the case of upgrading from older daemon, in this case
     container.HostConfig.IpcMode is unset and this is valid]
[v5: document old and new IpcMode values in api/swagger.yaml]
[v6: add the 'none' mode, changelog entry to docs/api/version-history.md]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7120976d74195a60334c688a061270a4d95f9aeb
Component: engine
2017-08-14 10:50:39 +03:00
de9b157e25 hide swarm plugins behind experimental flag
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 493002021094d72d405e1cd5bfa10b8080f67920
Component: engine
2017-08-08 18:33:25 -07:00
fae0c281b6 Windows: Add named pipe mount support
Current insider builds of Windows have support for mounting individual
named pipe servers from the host to the guest. This allows, for example,
exposing the docker engine's named pipe to a container.

This change allows the user to request such a mount via the normal bind
mount syntax in the CLI:

  docker run -v \\.\pipe\docker_engine:\\.\pipe\docker_engine <args>

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 54354db850664783918a1fc9d208bcfcf47c28e2
Component: engine
2017-08-07 11:34:36 -07:00
39189fe164 Fix api server null pointer def on inspect/ls null ipam-driver networks
- When a network is created with the null ipam driver, docker api server
  thread will deference a nil pointer on `docker network ls` and on
  `docker network inspect <nw>`. This because buildIpamResource()
  assumes a gateway address is always present, which is not correct.

Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
Upstream-commit: beebfc0cf6240c8af511eb4d7e29314c8de6ddf2
Component: engine
2017-08-03 13:35:58 -07:00
9762198ec1 Merge pull request #34272 from dmcgowan/update-logrus
Update logrus to v1.0.1 (Sirupsen -> sirupsen)
Upstream-commit: 8af4db6f002ac907b6ef8610b237879dfcaa5b7a
Component: engine
2017-08-01 18:53:33 -07:00
76e753b00b Merge pull request #34287 from thaJeztah/bump-api-version
Bump API version to 1.32
Upstream-commit: 1a0fbc4a6facd35ca93e4eded902e73d0d4b8378
Component: engine
2017-08-01 12:18:26 +02:00
1183f66b5b Merge pull request #34202 from thaJeztah/swagger-external-secrets-store
Add API documentation for plugable secret backends
Upstream-commit: 0fd90c4d5d8ab739d6f999a36d9c4096e89c8059
Component: engine
2017-08-01 10:59:08 +02:00
a179e7a813 Merge pull request #34302 from abhinandanpb/predefinednet
Changing the get network request to return swarm scope predefined net…
Upstream-commit: 3364e7da3fd9e2bc3e5d983e98413ddd7c48a89e
Component: engine
2017-07-31 17:08:04 -07:00