Commit Graph

31393 Commits

Author SHA1 Message Date
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
12bfda3c10 Merge pull request #34478 from thaJeztah/fix-swagger-todos
Update NetworkConfig definition in Swagger
Upstream-commit: 1454015ce96510fb677ab85bf26610f559a0c613
Component: engine
2017-08-16 11:07:25 +02:00
13f12ea9ac Merge pull request #34508 from Microsoft/jjh/mergestorageopt
Merge global storage options on create
Upstream-commit: cd902848e913aead3e8242eca8a6ed6c67e589e1
Component: engine
2017-08-15 18:13:13 +02:00
e80c7b1a0c Merge pull request #34504 from fcrisciani/ln-vendoring
Libnetwork vendoring
Upstream-commit: 036314622de7cfc62b5f9a88c849faf17c9bc1d3
Component: engine
2017-08-15 08:06:26 -07:00
7eea9c9616 Merge pull request #34109 from yummypeng/rm-link-when-rm-container
Bugfix: Remove links when remove container
Upstream-commit: b6498340b2baa6596553b2b56b43990a365a7b6a
Component: engine
2017-08-15 09:43:00 -04:00
9522e0432e Merge pull request #33450 from naveed-jamil-tenpearls/pkg/signal/trap
Add test coverage to signal/trap.go
Upstream-commit: 479cc38bb94178d48609def34dfb0eae87a9a815
Component: engine
2017-08-15 00:53:37 -07: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
fe13f30f0f Merge global storage options on create
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 932ae425e8a8aac86f70c249f3a0304101e83614
Component: engine
2017-08-14 15:47:54 -07:00
a71e5a5cde Merge pull request #34487 from tonistiigi/host-suffix-fix
Fix requests for docker host ending with slash
Upstream-commit: f148337da9afef5ecc06d1719d19a770079929ef
Component: engine
2017-08-14 13:29:02 -07:00
4233bbe278 Libnetwork vendoring
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 167564a798365d9924260e721954b7ca43322726
Component: engine
2017-08-14 09:31:23 -07:00
9685380dbb Merge pull request #34492 from AkihiroSuda/fix-integration-cli-on-swarm
Fix `make build-integration-cli-on-swarm`
Upstream-commit: 07227a1227e1cdecdd89060d98bf67d0f49503e6
Component: engine
2017-08-14 12:20:18 -04:00
13c5fe42cf Merge pull request #34419 from keloyang/config.v2.json
security: Chmod config.v2.json to 0600
Upstream-commit: e4c19aa529342e0c8947288cbf9a8cbbf025100a
Component: engine
2017-08-14 08:39:58 -07:00
fbf74e8b6c Merge pull request #34486 from kolyshkin/dm-misc
Misc fixes for devmapper
Upstream-commit: af3a9e33145add7994b3e8ea246fa5e5118a45bd
Component: engine
2017-08-14 17:20:40 +02:00
2b769b8b71 Merge pull request #34362 from kolyshkin/update-libdevmapper
Dockerfile*: bump devmapper library version
Upstream-commit: 31d8d2253ebb77ef7b341606cbdf0e76835e64db
Component: engine
2017-08-14 09:56:43 -04:00
99367ff683 Merge pull request #34087 from kolyshkin/ipcmode
Implement private and shareable ipc modes
Upstream-commit: bb6fc72cd2bd0f194940c7710d8ed8cf3fb99d21
Component: engine
2017-08-14 15:52:21 +02:00
ded67f686e devmapper autosetup: add check for thin_check
I was able to successfully use device mapper autoconfig feature
(commit 5ef07d79c) but it stopped working after a reboot.

Investigation shown that the dm device was not activated because of
a missing binary, that is not used during initial setup, but every
following time. Here's an error shown when trying to manually activate
the device:

> kir@kd:~/go/src/github.com/docker/docker$ sudo lvchange -a y /dev/docker/thinpool
> /usr/sbin/thin_check: execvp failed: No such file or directory
> Check of pool docker/thinpool failed (status:2). Manual repair required!

Surely, there is no solution to this other than to have a package that
provides the thin_check binary installed beforehand. Due to the fact
the issue revealed itself way later than DM setup was performed, it was
somewhat harder to investigate.

With this in mind, let's check for binary presense before setting up DM,
refusing to proceed if the binary is not there, saving a user from later
frustration.

While at it, eliminate repeated binary checking code. The downside is
that the binary lookup is happening more than once now -- I think the
clarity of code overweights this minor de-optimization.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 58a453f3f06c1daf34544da8aa16bb95e8e18010
Component: engine
2017-08-14 13:25:28 +03:00
1a431d82d1 Test cases for new ipc modes
These test cases cover various arguments for docker create/run --ipc
option, as well as daemon's --default-ipc-mode cli option and
configuration file parameter.

For the description of container IPC modes, see previous commit.

To run these:

	TESTFLAGS='-check.f IpcMode' make test-integration-cli

[v2: simplify TestDaemonEvents(), add default-ipc-mode presense check]
[v3: add TestDaemonIpcModeVSRestart]
[v4: ipcmode test now uses client lib instead of CLI (except for exec)]
[v5: nitpicks in comments]
[v6: add test case for "none"; fix a typo; simplify TestDaemonEvents() more]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 9a60e1cc874402d10eb7e45f62cce25bf5c41d30
Component: engine
2017-08-14 11:00:26 +03: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
94157b8e90 devmapper: refer to dockerd man page
...not the docker one.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 8b7bd58869725dce2f0fcfd582d23dc5e0cfcf8e
Component: engine
2017-08-14 10:09:58 +03:00
d92c40217f devmapper autoconfig: add mkdir
I tried using dm.directlvm_device but it ended up with the following
error:

> Error starting daemon: error initializing graphdriver: error
> writing docker thinp autoextend profile: open
> /etc/lvm/profile/docker-thinpool.profile: no such file or directory

The reason is /etc/lvm/profile directory does not exist. I think it is
better to try creating it beforehand.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6ca20ec771ab7c0ebf64c20021ca795746cf3ccb
Component: engine
2017-08-14 10:09:34 +03:00
bb626a427e Fix make build-integration-cli-on-swarm
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 2fddf9f6efc155c880dfa689bd7df3a5a31ba459
Component: engine
2017-08-12 06:53:25 +00:00
417e5624cd Fix requests for docker host ending with slash
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 823e88d4c4298c38130b9a387a45c47cf957a931
Component: engine
2017-08-11 10:47:02 -07:00
0f9d35cd6f Merge pull request #34000 from dnephin/test-integration-api
Introduce `test-integration` target
Upstream-commit: f34e4d295d5c17a78c33beb14b65e5d001c16968
Component: engine
2017-08-11 10:39:27 -07:00
2e5f24be1e Use container.HostConfig.ShmSize directly
It was noted[1] that container's HostConfig.ShmSize, if not set, should be
initialized to daemon default value during container creation.

In fact, it is already done in daemon.adaptContainerSettings, so we can use
value from container.HostConfig directly.

[1] https://github.com/moby/moby/pull/34087#discussion_r128656429

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 0fb1fb1ce0177cf31dd96e9fdb4a5f55155a5966
Component: engine
2017-08-11 03:29:27 -07:00
5963ab8f5e Merge pull request #34378 from fcrisciani/ln-vendoring
Vendoring libnetwork
Upstream-commit: aaee3ca6c1129f62eaa64a76a3f770ae09d04d09
Component: engine
2017-08-10 17:07:14 -07:00
c020b02684 Merge pull request #34452 from Microsoft/jjh/gowiniov0.4.5
Revendor Microsoft/go-winio @ v0.4.5
Upstream-commit: 45248ae668cd8ab02cf597ab9e9f72564a262f6c
Component: engine
2017-08-10 17:05:36 -07:00
14f2519dda Merge pull request #34470 from thaJeztah/fix-solaris-config
Fix solaris reference to config
Upstream-commit: 2638729c7a57332737e2096d68bed5e1940053d4
Component: engine
2017-08-10 09:41:50 -07:00
848a1fd437 Vendoring libnetwork
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: 709a433ec827b034b798e748d4393f7c9f3b3bc0
Component: engine
2017-08-10 08:51:30 -07:00
c75716b8e7 Merge pull request #33722 from TomSweeneyRedHat/tsweeney/privmessage
Add clarification to --privileged error message
Upstream-commit: 7ccd8bda77fb075b2c5d849f55445d0b4144acc9
Component: engine
2017-08-09 16:08:10 -07:00
479e9126c5 Merge pull request #34430 from AkihiroSuda/promote-overlay2
graphdriver: promote overlay2 over aufs
Upstream-commit: 2e38c07814fbb99364838df2cd1092744f6bd1e1
Component: engine
2017-08-09 21:41:36 +02:00
592e32b2a4 Fix solaris reference to config
Commit db63f9370e26d725357c703cbaf9ab63cc7b6d0a
extracted  daemon configuration to its own
package, but did not update the Solaris stubs.

This updates the Solaris daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 335033e25fae0173217e70d4b8dfc5df682ea913
Component: engine
2017-08-09 20:58:31 +02:00
028f9b05af Merge pull request #34445 from pmoust/f-seccomp-quotacl
seccomp: whitelist quotactl with CAP_SYS_ADMIN
Upstream-commit: bbb401de87b21659399909b15707cf2816be0f78
Component: engine
2017-08-09 11:53:13 -07:00
840bc1dc6a seccomp: whitelist quotactl with CAP_SYS_ADMIN
The quotactl syscall is being whitelisted in default seccomp profile,
gated by CAP_SYS_ADMIN.

Signed-off-by: Panagiotis Moustafellos <pmoust@elastic.co>
Upstream-commit: cf6e1c5dfd07f5048606bb7b21464c658e252322
Component: engine
2017-08-09 18:52:15 +03:00
7b76095dc9 Merge pull request #34455 from vieux/hide_swarm_plugins_exp
hide swarm plugins behind experimental flag
Upstream-commit: ab29a85103f2b251094cd0423d84de13cdb930ab
Component: engine
2017-08-09 17:52:14 +02:00
94b4666b88 Revendor Microsoft/go-winio @ v0.4.5
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 779469d9c98b83d54bc45f808de76c2088ffe8c7
Component: engine
2017-08-09 08:31:43 -07:00
48f5d911ea Fix exclude list in make.ps1
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e593b72cc9d8a2fd9c7cd98b82ed468dfe3577e2
Component: engine
2017-08-09 11:03:20 -04:00
b63db0a43c move api test client setup to a package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c66c0447efe9c7e7afdcf75b950897c67894256b
Component: engine
2017-08-09 11:02:57 -04:00
e443662141 Protect images in the integration/ suite
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5fa134b9061d0b794e9e5b887a8ea4ee15fecb61
Component: engine
2017-08-09 11:02:57 -04:00