Commit Graph

3028 Commits

Author SHA1 Message Date
45def429d3 Merge pull request #34424 from simonferquel/swarm-service-isolation
Added support for swarm service isolation mode
Upstream-commit: d91c5f42eb37c6f88cec4021c10c0a1ded1785c3
Component: engine
2017-11-01 16:41:10 -04:00
7bfb66c670 Merge pull request #35347 from lioncruise/patch-1
Fix grammatical problems in several annotations
Upstream-commit: 100ec844ccad6b79bcb11650e32e9a05ff51a441
Component: engine
2017-10-31 15:25:27 -07:00
9e1b28e972 Merge pull request #35343 from thaJeztah/bump-api-version-1.35
Bump API version to 1.35
Upstream-commit: 3ba1dda1914fa7d380d9d3220c3b158a41f90cba
Component: engine
2017-10-31 12:37:12 -07:00
95c878aac5 Fix grammatical problems in several annotations
Signed-off-by: qinshijun <272700767@qq.com>
Upstream-commit: 3c376a882b89bc1ff4f7b47667f49440a516bd70
Component: engine
2017-10-31 22:47:58 +08:00
6b11145c27 Bump API version to 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ba6b5aa7f28dbc76c6e0c494eb228a652a0d55a7
Component: engine
2017-10-31 12:57:14 +01:00
2700d23ec3 Merge pull request #35102 from ripcurld0/doc_31926
Elaborate more about port allocation in docs
Upstream-commit: a6f09a7509cd77b4ce0bf26845a253a7d9997d11
Component: engine
2017-10-30 20:28:36 +01:00
1377e81acb Added support for swarm service isolation mode
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: f28cb422e69bd4239401e6ea32b65b56485d6691
Component: engine
2017-10-30 16:16:18 +01:00
b3821c58fe Merge pull request #34999 from kolyshkin/wait-on-rm
ContainerWait on remove: don't stuck on rm fail
Upstream-commit: 220d6c4aff7e3c8887f8c39e8f47b4aca21ab22f
Component: engine
2017-10-29 11:04:41 -07:00
8efb0e1631 ContainerWait on remove: don't stuck on rm fail
Currently, if a container removal has failed for some reason,
any client waiting for removal (e.g. `docker run --rm`) is
stuck, waiting for removal to succeed while it has failed already.
For more details and the reproducer, please check
https://github.com/moby/moby/issues/34945

This commit addresses that by allowing `ContainerWait()` with
`container.WaitCondition == "removed"` argument to return an
error in case of removal failure. The `ContainerWaitOKBody`
stucture returned to a client is amended with a pointer to `struct Error`,
containing an error message string, and the `Client.ContainerWait()`
is modified to return the error, if any, to the client.

Note that this feature is only available for API version >= 1.34.
In order for the old clients to be unstuck, we just close the connection
without writing anything -- this causes client's error.

Now, docker-cli would need a separate commit to bump the API to 1.34
and to show an error returned, if any.

[v2: recreate the waitRemove channel after closing]
[v3: document; keep legacy behavior for older clients]
[v4: convert Error from string to pointer to a struct]
[v5: don't emulate old behavior, send empty response in error case]
[v6: rename legacy* vars to include version suffix]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: f963500c544daa3c158c0ca3d2985295c875cb6b
Component: engine
2017-10-25 13:11:56 -07:00
e1ac8beab7 Merge pull request #35030 from tossmilestone/34459-fix-network-create-conflict-errcode
Fix returned error code for network creation from 500 to 409
Upstream-commit: e309f98b84fd3aaf527512a925e2b7d066135a4d
Component: engine
2017-10-25 14:29:20 +02:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
6bfaa3dd46 Elaborate more about port allocation in docs
Describe more how host port allocation is done when
container is stopped/started in "PublishAllPorts".

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: dfd706e1a59c3830c87b8240c466489ae6cc9d15
Component: engine
2017-10-17 15:19:54 +03:00
c077b5031b Merge pull request #35151 from thaJeztah/always-return-version-information
Always return version and server headers
Upstream-commit: 591b2eeeb37c285d637a2c4071a59302010128cc
Component: engine
2017-10-11 18:11:35 -07:00
594afcb5ff Merge pull request #35144 from Microsoft/jjh/fixdownlevel
Fix regression on inspect
Upstream-commit: 1ffa10ee2630917e4f2a88f5e4daf34d700eaa1f
Component: engine
2017-10-12 00:52:28 +02:00
f8ec7d1b83 Always return version and server headers
If a 400 error is returned due to an API version mismatch, no
version and server-identification headers were returned by the API.

All information in these headers is "static", so there is no
reason to omit the information in case of an error being
returned.

This patch updates the version middleware to always
return the headers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: e9dac5ef5e8a4b0ecce0c89d337fea90f2c6aef3
Component: engine
2017-10-11 22:06:43 +02:00
2890f26aa9 Merge pull request #35150 from thaJeztah/fix-api-version-check
Return 400 error if API client is too new
Upstream-commit: 6f117e266f244b06c3e59fc6ab66c652b2e601ec
Component: engine
2017-10-11 11:26:12 -07:00
9dcd903628 API: minor fixes in the README
The main point is to fix a non ASCII space character that wrecks the
markdown handling.

Signed-off-by: Akim Demaille <akim.demaille@docker.com>
Upstream-commit: ce58cd5a346d2ef02cd9b893e4a51f10382aaf11
Component: engine
2017-10-11 16:12:10 +02:00
5a2940263e Merge pull request #35064 from LK4D4/replace_timer
Replace NewTimer().C with After
Upstream-commit: b6aa01570cd8d679afd716f648aeaeb35238fa79
Component: engine
2017-10-10 08:47:37 -07:00
efe89988fe Return 400 error if API client is too new
Commit e98e4a71110fd33852bb755a9b8b4ebc9df904db implemented API version
negotiation using the `/_ping` endpoint. In that change, URL validation for the
maximum supported API version was removed from the API server (validation for
the _minimum_ version was kept in place).

With this feature, clients that support version negotiation would negotiate the
maximum version supported by the daemon, and downgrade to an older API version
if the client's default API version is not supported.

However, clients that do _not_ support version negotiation can call API versions
that are higher than the maximum supported version. Due to the missing version
check, this is silently ignored, and the daemon's default API version is used.

This is a problem, because the actual API version in use is non-deterministic;
for example, calling `/v9999.9999/version` on a daemon that runs API v1.34 will
use API v1.34, but calling the same URL on an older daemon may use API version
v1.24.

This patch reverts the removal of the API check for maximum supported versions.
The documentation has been updated accordingly

Before this patch is applied, the daemon returns a 200 (success):

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/Users/sebastiaan/Library/Containers/com.dock) port 80 (#0)
    > GET /v9999.9999/version HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.54.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Api-Version: 1.32
    < Content-Length: 240
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 09:11:29 GMT
    < Docker-Experimental: true
    < Ostype: linux
    < Server: Docker/17.09.0-ce (linux)
    <
    {"Version":"17.09.0-ce","ApiVersion":"1.32","MinAPIVersion":"1.12","GitCommit":"afdb6d4","GoVersion":"go1.8.3","Os":"linux","Arch":"amd64","KernelVersion":"4.9.49-moby","Experimental":true,"BuildTime":"2017-09-26T22:45:38.000000000+00:00"}
    * Connection #0 to host localhost left intact

After this patch is applied, a 400 (Bad Request) is returned:

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/var/run/docker.sock) port 80 (#0)
    > GET /v9999.9999/info HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.52.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 08:08:34 GMT
    < Content-Length: 89
    <
    {"message":"client version 9999.9999 is too new. Maximim supported API version is 1.34"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 01f9227ec9116b3969cb0725787e43a5fa26aac2
Component: engine
2017-10-10 11:17:48 +02:00
3730192eec Fix downlevel regression
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9b2a20819e7b29ce4dee46d87e8c32ae7ca9899
Component: engine
2017-10-09 13:47:28 -07:00
a7e36cfccc Fix returned error code for network creation from 500 to 409
Signed-off-by: He Xiaoxi <tossmilestone@gmail.com>
Upstream-commit: ab1871872d547e01f78a8a6c7af96c6cf05f793d
Component: engine
2017-10-08 16:00:00 +08:00
3d973055bf LCOW: API change JSON header to string POST parameter
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d98ecf2d6cdad7dae65868398440cfdc855e5263
Component: engine
2017-10-06 15:26:48 -07:00
35db73fa01 LCOW: API: Add platform to /images/create and /build
Signed-off-by: John Howard <jhoward@microsoft.com>

This PR has the API changes described in https://github.com/moby/moby/issues/34617.
Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded
OCI Image-spec `Platform` structure.

In addition, it renames (almost all) uses of a string variable platform (and associated)
methods/functions to os. This makes it much clearer to disambiguate with the swarm
"platform" which is really os/arch. This is a stepping stone to getting the daemon towards
fully multi-platform/arch-aware, and makes it clear when "operating system" is being
referred to rather than "platform" which is misleadingly used - sometimes in the swarm
meaning, but more often as just the operating system.
Upstream-commit: 0380fbff37922cadf294851b1546f4c212c7f364
Component: engine
2017-10-06 11:44:18 -07:00
8d9cd6c880 Replace NewTimer().C with After
It is the same thing

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
Upstream-commit: 1a517a4a429d2b4db15383fc9d514fc8db66f8d3
Component: engine
2017-10-04 14:24:19 -07:00
c1d495468d Add PortConfig.PublishMode to API documentation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fd90733972c6e78a0871b068e01e29ae1ac97fd7
Component: engine
2017-10-04 15:34:08 +02:00
6e3b4640d2 Bump API version to 1.34
Docker 17.10 was cut off from ab2b03a0e139537376bbf66c1e1e9e897a403f06

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 288abf0854852b4542da359400b3c29e99941fc9
Component: engine
2017-09-30 01:13:20 +02:00
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