Commit Graph

2983 Commits

Author SHA1 Message Date
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
d659edcaf5 Update logrus to v1.0.1
Fixes case sensitivity issue

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 1009e6a40b295187e038b67e184e9c0384d95538
Component: engine
2017-07-31 13:16:46 -07:00
27851173aa Changing the get network request to return swarm scope predefined networks
Starting 17.06 swarm service create supports service creates with predefined
networks like host and bridge. Due to the nature of the feature, swarm manager
has a swarm scope predefined networks in addition to local scoped
predefined networks on all nodes. However network inspects for swarm scoped
predefined networks was not possible. The fix adds support for network inspect
for swarm scoped predefined networks.

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
Upstream-commit: 5bfefb2d3662fa066ddf0d0e10cac93ee70f7ae8
Component: engine
2017-07-31 13:05:30 -07:00
4bac077379 Add API documentation for plugable secret backends
Documents the API changes introduced in

0304c98d85404fe75a1b4a35d3c111931e062f41 and
08f7cf05268782a0dd8e4c41a4cc65fdf78d09f2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c8dad44c326d9d2131f94babbc535e7f442db290
Component: engine
2017-07-28 00:00:53 +02:00
beb3caf7ab Bump API version to 1.32
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 05121d555475b3d7cfa5b29f22dc85262cd1a1a8
Component: engine
2017-07-27 18:50:31 +02:00
3a8935f2e8 Update API plugin response examples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4735c7663201ce1bf618e2aa505d7813a331be3f
Component: engine
2017-07-27 18:43:13 +02:00
6118c4c4b5 Merge pull request #34247 from thaJeztah/fix-restartpolicy-default
Fix RestartPolicy default value
Upstream-commit: 36e4e952f8f28ff661345328bd8da0ce9f5f2f86
Component: engine
2017-07-27 00:21:48 +02:00
993196bb20 Merge pull request #34249 from thaJeztah/remove-unused-constants
Remove unused constants in plugin_responses
Upstream-commit: 1ea52c481268d523e715a6d742718679d87d9f61
Component: engine
2017-07-26 16:44:51 -04:00
8f5aa8e137 Merge pull request #33440 from RenaudWasTaken/genericresource
Added support for Generic Resources
Upstream-commit: 9319a8a2dd5760b3d0eda359b8c3872f5e37aa87
Component: engine
2017-07-25 15:32:25 -04:00
66ffeac642 Remove unused constants in plugin_responses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9bb57aa3fef6c1f31e9e8344e06670c3d41e4395
Component: engine
2017-07-25 17:07:04 +02:00
b0a6694bbf Fix RestartPolicy default value
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fc48b5529dca3907ade273921a14906be796e333
Component: engine
2017-07-25 16:14:59 +02:00
2029cf1c2d Added support for Generic Resources
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
Upstream-commit: 87e1464c438f4163e2694a0bf29ae5a45903449b
Component: engine
2017-07-24 17:49:56 -07:00
55833ad972 Merge pull request #34174 from aaronlehmann/logattributes
Avoid using a map for log attributes
Upstream-commit: 901fe35bd3ab1d4c25872c8a92577c4f088bba74
Component: engine
2017-07-21 22:31:51 +02:00
0e1ec67528 Merge pull request #34186 from thaJeztah/api-update-example-data
Improve API docs for UsageData
Upstream-commit: a14f06a86520d7dc865ccea08ae40dfa674d2445
Component: engine
2017-07-20 09:38:28 +02:00
21a816c87d Merge pull request #34183 from thaJeztah/api-changelog-add-volume-created-at
Update API history and example response for volume CreatedAt
Upstream-commit: 8299f1727884c7ec41f21e70906d5b3a39fa7feb
Component: engine
2017-07-19 22:13:34 +02:00
8830d4f1ff api: Update swagger.yaml for configs
Also fix bad reference to ServiceSpec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: ea1d14a189d62df34427b037a6d043ae3028760b
Component: engine
2017-07-19 09:52:25 -07:00
fc4916e72f Improve API docs for UsageData
The docs did not mention when this information
was set, and what the `-1` value indicated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 194f635ce7d097f550986bc3169ab59158f5aa68
Component: engine
2017-07-19 16:25:38 +02:00
0112a044fc Update API history and example response for volume CreatedAt
This adds the new `CreatedAt` field to the API version history
and updates some examples to show this information.

The `CreatedAt` field was implemented in a46f757c4043031379362c5d6b3bad7562ab9fed

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 48a83a3a18185e0ad48737d448524670f8fac4bf
Component: engine
2017-07-19 16:18:08 +02:00
ba4262a451 Merge pull request #32453 from cpuguy83/default_enable_pprof
Enable pprof/debug endpoints by default
Upstream-commit: eb9e5cd14bbe9b21e1774d92e2023197869d7401
Component: engine
2017-07-19 16:13:12 +02:00
b337882c5b Avoid using a map for log attributes
Having a map per log entry seemed heavier than necessary. These
attributes end up being sorted and serialized, so storing them in a map
doesn't add anything (there's no random access element). In SwarmKit,
they originate as a slice, so there's an unnecessary conversion to a map
and back.

This also fixes the sort comparator, which used to inefficiently split
the string on each comparison.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: b642b3f21f17cf50c79e464d3aedc93b2dbf0fb0
Component: engine
2017-07-18 19:01:20 -07:00