Commit Graph

234 Commits

Author SHA1 Message Date
5eaf5cc8fa Merge pull request #33887 from thaJeztah/update-version-error
Fix NewVersionError() for clients using default version
Upstream-commit: 45cad73ea8abc5e87d5db1a4a47c8565531d769f
Component: engine
2017-07-12 15:24:00 +02:00
c782cb6c44 Make plugin emit strongly typed, consumable events
Enables other subsystems to watch actions for a plugin(s).

This will be used specifically for implementing plugins on swarm where a
swarm controller needs to watch the state of a plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 72c3bcf2a533a827402945e3a55872e2db4fb024
Component: engine
2017-07-06 14:26:06 -04:00
c36d6e2e41 Merge pull request #33859 from tonistiigi/session-includepaths
Add path filtering to build session client
Upstream-commit: 19ee87361685ae63aa2eca4a2ae5a2035484814b
Component: engine
2017-07-05 18:21:48 -07:00
ec1ee882b3 Merge pull request #33322 from jsoref/spelling
Spelling
Upstream-commit: ff4f700f74450018f36d014f3cde0ff1b9c17fb3
Component: engine
2017-07-04 15:46:34 +02:00
f2ec8286bb Merge pull request #33494 from cpuguy83/document_stream_format_in_client_lib
Add stream format details for attach/logs endpoint
Upstream-commit: a9358df62cde2deb8184c742e6fb8d16c98a04a9
Component: engine
2017-07-03 22:02:24 -07:00
643654c2f0 Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 39bcaee47b8a284a46b761afe218ba7deda0d482
Component: engine
2017-07-03 13:13:09 -07:00
1a311235ba Always perform version-negotiation
If a client is initialized without a specific
version set, version negotiation would not be
functional.

This patch changes the behavior to always
perform version negotation (if called), in
which case the "current" (maximum supported
API version) is used as a default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5975dc4b4b8a6fa2e0edd1f1b113e7f66dad732b
Component: engine
2017-06-29 22:24:49 -07:00
5852d59e6d Fix NewVersionError() for clients using default version
The NewVersionError checks if the client is using the API version
required for using a specific feature.

If the client is initialized without setting a specific version, an
error would be generated because it was not possible to compare
versions. However, a client without explicit version set is running
the latest supported version.

This patch changes the behavior to only generate an error if a version
was set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ff2ed1853099a210245814b4263ce1c92b14c153
Component: engine
2017-06-29 22:22:32 -07:00
e0679f41e0 Merge pull request #33827 from cpuguy83/return_ping_data_if_available
Set ping version even on error
Upstream-commit: 654bb6368b838bc619a5d612a39abb385fbd45c3
Component: engine
2017-06-29 12:27:23 -07:00
85421deb82 Set ping version even on error
In some cases a server may return an error on the ping response but
still provide version details. The client should use these values when
available.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 27ef09a46ffeb8ba42548de937b68351009f30ea
Component: engine
2017-06-29 12:42:14 -04:00
30ba67aee0 Do not add duplicate platform information to service spec
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: da85b62001ec390bdc30b321c4a5cd23c17eeb81
Component: engine
2017-06-28 16:01:05 -07:00
77cf31b37e add test for filesync path filtering and testutil helper
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4141d8fe5da596e7ee1eec217378aeb684d0a99e
Component: engine
2017-06-28 09:12:36 -07:00
1c25f0d80a builder: enable path filtering for filesync session
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ad46348d7c9f8a84d61e1ba5f08c8fd0727e4ebc
Component: engine
2017-06-28 09:12:30 -07:00
ee1b2dfe8c Merge pull request #33467 from bschwind/copy-documentation
Add note to CopyToContainer documentation
Upstream-commit: 5564fad4068619e7d0c5fd7defe7dd5e3f0edd8c
Component: engine
2017-06-24 00:19:51 -07: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
b1e4d7d884 Add long-running client session endpoint
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ec7b6238c31e26702ecf366731532e189b5da142
Component: engine
2017-06-22 11:22:41 -07:00
24b6b491fa pull client API version negotiation out of the CLI and into the client
Signed-off-by: Royce Remer <royceremer@gmail.com>
Upstream-commit: 5f1d94e569592fc2680f8661e16d0e5b02e82492
Component: engine
2017-06-20 22:58:16 -07:00
125062e5cf Add note to CopyToContainer documentation
Signed-off-by: Brian Schwind <brianmschwind@gmail.com>
Upstream-commit: 1c3071e487db96ba8274ac2388eca0002e9cee77
Component: engine
2017-06-20 14:49:38 +09:00
da632307b9 Make TestServiceCreateCompatiblePlatforms use actual API response
The `TestServiceCreateCompatiblePlatforms()` test was confusing, because it
did not actually use the mocked API response, but used a local
`distributionInspectBody` variable to verify that the `/distribution/` endpoint
was called.

This flow was especially confusing, because a comment in the test describes;

    "check if the /distribution endpoint returned correct output"

If (for whatever reason), the endpoint was not called, the test would panic,
because the `distributionInspectBody` would not be set.

This patch rewrites the test to use the actual API response that is returned
by the mock, and verifies that the information returned by the `/distribution/`
endpoint is properly used in the service's definition.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f3fce00ef3f3b7ead5ac211f9aafabfebf820c2f
Component: engine
2017-06-13 14:25:50 +02:00
88669e2de2 Merge pull request #33571 from thaJeztah/client-api-version-checks
Add API version checks to client
Upstream-commit: ae487e543c2916bec05dc01ebd364a9d3b88595d
Component: engine
2017-06-13 10:50:05 +02:00
99aad7f08b Add scope filter in /networks/<id>
This fix tries to add a `scope` in the query of `/networks/<id>`
(`NetworkInspect`) so that in case of duplicate network names,
it is possible to locate the network ID based on the network
scope (`local`, 'swarm', or `global`).

Multiple networks might exist in different scopes, which is a legitimate case.
For example, a network name `foo` might exists locally and in swarm network.

However, before this PR it was not possible to query a network name `foo`
in a specific scope like swarm.

This fix fixes the issue by allowing a `scope` query in `/networks/<id>`.

Additional test cases have been added to unit tests and integration tests.

This fix is related to docker/cli#167, moby/moby#30897, moby/moby#33561, moby/moby#30242

This fix fixes docker/cli#167

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 158b2a1875cf33f3560dedaeb0149e1fbe54c1ef
Component: engine
2017-06-12 09:54:25 -07:00
1674838b6a Add API version checks to client
The Docker CLI already performs version-checks when
running commands, but other clients consuming the API
client may not do so.

This patch adds a version check to various
client functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1401342f466bafbb902157a2460746ac829e0b01
Component: engine
2017-06-10 01:57:55 +02:00
7910a90b94 Merge pull request #33424 from allencloud/add-swarm-unlock-test-in-client
add swarm unlock test in client
Upstream-commit: 47218448113da4a06d6b0397821007d2b865ede5
Component: engine
2017-06-09 08:39:23 -04:00
a215dfc2d2 Merge pull request #33262 from keloyang/exec-block
Add a error check in postHijacked to avoid docker exec command blocking.
Upstream-commit: f35157433e38c90a9a067020609c7e250fc847af
Component: engine
2017-06-09 09:20:04 +08:00
523841f2f9 Add a error check in postHijacked to avoid docker exec command blocking.
When user execute docker exec command, docker daemon maybe have err return because
of ExecExists check, and then the hijack stream will not be close, it can lead to
docker exec command block.

Signed-off-by: yangshukui <yangshukui@huawei.com>
Upstream-commit: 26231b29e7881d25822bffd740d5f73fc2687460
Component: engine
2017-06-08 15:46:50 +08:00
9968cd1aa2 Add stream format details for attach/logs endpoint
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 48829ddf885eb656bff6dcf053bf96471b106bf0
Component: engine
2017-06-02 12:32:25 -04:00
6f84604b78 client: Use string concatenation instead of Sprintf
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 44c9ccc069c1bfda25ad6fb5932eeeceaa8de491
Component: engine
2017-06-02 14:01:57 +02:00
02f992f2b8 Fix Typos: continer,contianer -> container
Signed-off-by: Chen Min <chenmin46@huawei.com>
Upstream-commit: 2b62eb434be4770c101ef79666a952fd7f43a742
Component: engine
2017-06-01 19:21:01 +08:00
db321ad50e add swarm unlock test in client
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 8ff023fe5a6c33a7d4663978cf57afb2fffba9af
Component: engine
2017-05-29 00:22:24 +08:00
d64468f256 Merge pull request #33279 from nishanttotla/fix-service-image-issues
Ensure service images get default tag and print familiar strings
Upstream-commit: 5648a1ada223d692615072af26d0ce6e23415006
Component: engine
2017-05-22 21:45:11 +01:00
45dcc1512b Merge pull request #33253 from dave-tucker/clientHost
client: Expose ClientHost to client users
Upstream-commit: ab2abb0d940476fcb56d2ee565afdf1bc4d525d4
Component: engine
2017-05-22 16:27:43 +01:00
4a211248b9 client: Expose DaemonHost to client users
This commit exposes `Client.host` as `Client.DaemonHost()`
This allows users of the client, a CLI for example, to query the Host
that the client is attempting to contact and vary their behaviour
accordingly. For example, to allow client-side configuration of
HTTP proxy settings for a number of different docker hosts.

Signed-off-by: Dave Tucker <dt@docker.com>
Upstream-commit: 6ce6ae1cd11d888e0c8ede20926b86981cee5ce1
Component: engine
2017-05-22 13:25:11 +01:00
8d6081fcd1 Adding unit tests for pin by digest (client)
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 75c7536d2e2e328b644bf69153de879d1d197988
Component: engine
2017-05-19 10:48:12 -07:00
93bcab0aa8 Ensure service images get default tag and print familiar strings
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 5efcec77170dd6c4087d4f1fb3695c32d94edfb4
Component: engine
2017-05-19 10:35:34 -07:00
87298d4be7 Remove deadlock in ContainerWait
when `cli.post(...)` fails `errC <- err` blocks because `errC` is unbufferd.

Signed-off-by: Simon Menke <simon.menke@gmail.com>
Upstream-commit: 4d2d2ea39336aade783c5c415b83d129bdd339bb
Component: engine
2017-05-19 09:23:52 +02:00
0d783a82c9 Merge pull request #33267 from YuPengZTE/devImageWithDigestString
ineffectual assignment to isCanonical, delete it, and make the "if" sentence to fit the golang usage
Upstream-commit: b0dd3dfc1184b210854b62c231b7b074dd6dbd26
Component: engine
2017-05-18 23:37:52 +02:00
a8771c2674 ineffectual assignment to isCanonical, delete it
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
Upstream-commit: b28c1eae01e73fb92fe46f60a1bbd4e4f5a223b1
Component: engine
2017-05-18 17:16:19 +08:00
5e539a93fd Updating test for compatible platforms to test unmarshal body
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 7d4b8fb3b56168326f36157064741539f34490b7
Component: engine
2017-05-17 17:12:22 -07:00
3ff6579fec Adding compatible platforms to service spec
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 587d07cca89be978b9f9ca3203ad28b7179e49fd
Component: engine
2017-05-17 16:20:42 -07:00
6f26254653 Merge pull request #32237 from jlhawn/update_container_wait
Update Container Wait
Upstream-commit: c053a2069e1c8e99488517071540fb3e526233f3
Component: engine
2017-05-17 02:39:52 +02:00
fa44d02011 Update ContainerWait API
This patch adds the untilRemoved option to the ContainerWait API which
allows the client to wait until the container is not only exited but
also removed.

This patch also adds some more CLI integration tests for waiting for a
created container and waiting with the new --until-removed flag.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Handle detach sequence in CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Update Container Wait Conditions

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Apply container wait changes to API 1.30

The set of changes to the containerWait API missed the cut for the
Docker 17.05 release (API version 1.29). This patch bumps the version
checks to use 1.30 instead.

This patch also makes a minor update to a testfile which was added to
the builder/dockerfile package.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Remove wait changes from CLI

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address minor nits on wait changes

- Changed the name of the tty Proxy wrapper to `escapeProxy`
- Removed the unnecessary Error() method on container.State
- Fixes a typo in comment (repeated word)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Use router.WithCancel in the containerWait handler

This handler previously added this functionality manually but now uses
the existing wrapper which does it for us.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Add WaitCondition constants to api/types/container

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

- Update ContainerWait backend interface to not return pointer values
  for container.StateStatus type.
- Updated container state's Wait() method comments to clarify that a
  context MUST be used for cancelling the request, setting timeouts,
  and to avoid goroutine leaks.
- Removed unnecessary buffering when making channels in the client's
  ContainerWait methods.
- Renamed result and error channels in client's ContainerWait methods
  to clarify that only a single result or error value would be sent
  on the channel.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Move container.WaitCondition type to separate file

... to avoid conflict with swagger-generated code for API response

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

Address more ContainerWait review comments

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 4921171587c09d0fcd8086a62a25813332f44112
Component: engine
2017-05-16 15:11:39 -07:00
6b1b90eeb8 Disabling digest pinning for API versions < 1.30
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: c0afd9c873183604e57282e1cf47605c1f1e4d43
Component: engine
2017-05-15 16:42:43 -07:00
6b46f385fc Moving docker service digest pinning to client side
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: c1635c1ae3459e41fea3adb8188d9b3ce94f21a0
Component: engine
2017-05-15 16:42:43 -07:00
e768870c69 Merge pull request #32987 from allencloud/add-swarm-get-unlock-key-test-in-client
add swarm get unlock key test for client package
Upstream-commit: 3183031581d16e06b5386b1860ea6bfaa734ebce
Component: engine
2017-05-15 09:56:43 -04:00
81db28deb9 Merge pull request #32996 from dperny/service-logs-support-details
Fix Ambigious Logs Format and Add Support for Details in Service Logs
Upstream-commit: 7fd8a9382c0fd3f23002288e357b5612b869a974
Component: engine
2017-05-15 13:57:44 +02:00
462508ec1a fix typos in function comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 4a98f9ef7fdb6f6f77516fb030293fbc0ff659dc
Component: engine
2017-05-14 13:05:41 +08:00
25f28a5159 add swarm get unlock key test for client package
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: a86023eaa93f18bfefb345a5e13c88156abaa6fa
Component: engine
2017-05-14 11:09:19 +08:00
51fcae249a Change log details encoding format and support details on service logs
URL query encode log details, so that characters like spaces don't make
log parsing ambiguous. Add a helper function to parse these details to a
map, if needed

Add support for details on service logs

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 68f21418ac1f1acb2874b45878a5938475becf1f
Component: engine
2017-05-12 10:53:44 -07:00
f1fba04069 Add configs support to client
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 102738101a68711c2ca50e36b24d389c35d087df
Component: engine
2017-05-11 10:08:21 -07:00
9d2b3f6463 Return error on client redirect
From Go 1.8 HTTP client redirect behaviour is changed:
When status code is 301, 307 or 308, the client
automatically converts it to a new HTTP request.

This behaviour change manifests in the client in that
before the 301 was not followed and the client did not generate
an error, but now results in an error message:
"Error response from daemon: page not found."

To fix that a new redirect policy is forced by setting
HTTP Client's CheckRedirect.
That policy is to return an error for any 301, 307 or 308
in the response's status code to a non-GET request.
The error message specifies that the daemon could not
process the request and it is probably due to bad
arguments that were provided by the user.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: eb36d6021618f788012c166a533f1b321cda9695
Component: engine
2017-05-11 15:39:41 +03:00