Commit Graph

57 Commits

Author SHA1 Message Date
5a73ccd4a8 builder: add prune options to the API
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8ff7847d1cf0f156b8a7cf1450aa944ef636c747)
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 3153708f13ceefc3e8e4d4a93778dcc9e4347f5a
Component: engine
2018-09-04 15:02:28 +00:00
37b7f3706f client: add WithDialContext() and client.Dialer()
WithDialContext() allows specifying custom dialer for hijacking and supposed to
replace WithDialer().
WithDialer() is also updated to use WithDialContext().

client.Dialer() returns the dialer configured with WithDialContext().

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: edac92409a3b1d0cfb7f5c0e2d10b3bb71f27245
Component: engine
2018-07-28 23:35:47 +09:00
edce20e895 builder: add graceful cancellation endpoint
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 0bddd4ccfee5b7f4f69cd4757f053214be2ad4cd
Component: engine
2018-06-10 10:05:26 -07:00
422bb44235 Make client underlying HTTP client accessible
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
Upstream-commit: 5a84124739a809bcdb5830fd385440027ddd910f
Component: engine
2018-05-16 05:24:11 +02:00
1cb0dc30a7 Fix swagger volume type generation
This was broken by bf6a790f00ab96bb8857e3c73502909ee5e36217

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b16b125bb4326e2eec9948fd54ca8c5d83eba36a
Component: engine
2018-05-14 13:46:20 -04:00
e3af8e0774 Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7d62e40f7e4f3c17d229a7687d6fcca5448de813
Component: engine
2018-04-23 13:52:44 -07:00
49adb54d71 Remove duplicate calls for getting an APIClient
Remove request.SockRequest
Remove request.SockRequestHijack
Remove request.SockRequestRaw()
Remove deprecated ParseHost
Deprecate and unexport more helpers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0a91ba2d8cfe16df0ba37c1e283c8e3dbbb086d4
Component: engine
2018-02-20 17:27:24 -05:00
be83c11fb0 Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f0d95fa6ee7f865597c03b9e63702cdcb0f7067
Component: engine
2018-02-05 16:51:57 -05:00
ed76e0e519 Alias container and network packages to stop name clashes
Signed-off-by: Adam Pointer <adam.pointer@gmx.com>
Upstream-commit: 7732ca94fc67a28cbd37c292dc29216255685eba
Component: engine
2018-01-19 10:26:41 +00:00
016304f346 Use correct type for ContainerExecAttach
ContainerExecAttach used `types.ExecConfig` instead of `types.ExecStartCheck`,
which is the type that's expected by the `/exec/execid/start` API endpoint.

Investigating when this inconsistency was introduced, I found that the client has
sent the additional properties since its first imlpementation in
c786a8ee5e9db8f5f609cf8721bd1e1513fb0043.

The `postContainerExecStart()` at that time used the "jobs" package, which
only took the information from the body that was needed (`Detach` and `Tty`).

Commit 24425021d26f29a475702064181e6c99fb6bd1c5 refactored the Exec commands
to remove the "jobs", and introduced the `ExecStartCheck` type, but failed to
update the `cli.hijack()` call with the new type.

The change in this patch should not affect compatibility with older clients,
as the additional information from the `ExecConfig` type is not used (the
API server already decodes to the `ExecStartCheck` type).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5fee8bddfeb9b268f3e0b3c91e0932ee9a5eff83
Component: engine
2017-10-09 01:25:46 +02: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
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
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
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
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
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
3d267a0dc8 Change "service inspect" to show defaults in place of empty fields
This adds a new parameter insertDefaults to /services/{id}. When this is
set, an empty field (such as UpdateConfig) will be populated with
default values in the API response. Make "service inspect" use this, so
that empty fields do not result in missing information when inspecting a
service.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 1d274e9acfe96b98be3ec956636ff4e5c70e98af
Component: engine
2017-04-10 13:41:16 -07:00
93e346635c Add support for task and arbitrary combo logs
Refactored the API to more easily accept new endpoints. Added REST,
client, and CLI endpoints for getting logs from a specific task. All
that is needed after this commit to enable arbitrary service log
selectors is a REST endpoint and handler.

Task logs can be retrieved by putting in a task ID at the CLI instead of
a service ID.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: d330dc3223df7e6c2b066373718709e34e19efca
Component: engine
2017-04-03 18:40:54 -07:00
ff11389227 Enhance network inspect to show all tasks, local & non-local, in swarm mode
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Upstream-commit: 14f76a21db71c5a817cb4d1e27f9940cefd5c820
Component: engine
2017-03-13 17:52:08 -07:00
28da29ca6e Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

The plugin must be disabled while upgrading (errors out if enabled).
This does not add any convenience flags for automatically
disabling/re-enabling the plugin during before/after upgrade.

Since an upgrade may change requested permissions, the user is required
to accept permissions just like `docker plugin install`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 03c694973968f63743ed53cef83d0b7455695081
Component: engine
2017-02-03 16:21:12 -05:00
947241845a Add --filter enabled=true for docker plugin ls
This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a66e0dc349dad2d45685846a95fe1d6da967a46d
Component: engine
2017-01-26 13:16:11 -08:00
bc911a640c Merge pull request #28409 from dnephin/swagger-gen-more
Generate more types from the swagger spec
Upstream-commit: a69c4129e086e4e7b86cce7d2682685dfdc6f2d2
Component: engine
2017-01-26 10:35:34 -08:00
fe46c62362 Add SecretUpdate method to client
closes #28678

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

Update cli/command/service/update_test.go

Fixes test build error:

  secretAPIClientMock does not implement "github.com/docker/docker/client".SecretAPIClient (missing SecretUpdate method)

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 77b8465d7e68ca102d7aae839c7b3fe0ecd28398
Component: engine
2017-01-13 09:51:05 -08:00
f43a9bc718 Convert ContainerTopOKResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 16bdbaaa3357dc1be7d74a283a3ed8d0d861a461
Component: engine
2017-01-03 11:47:47 -05:00
c049133b66 Generate ImageDeleteResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5988b84e4fd9a512e3e8f98b3cfd7c030a4f013e
Component: engine
2017-01-03 11:47:47 -05:00
0a6e02b356 Generate ImageHistory from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b462c93edb44790ca309e3721950cb23be5d7d62
Component: engine
2017-01-03 11:47:44 -05:00
483e5a0688 Generate ContainerChanges from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b83d9bf6a9d92731573631ebd077a00e3f60c0cd
Component: engine
2017-01-03 09:35:40 -05:00
478844dff8 Implement content addressability for plugins
Move plugins to shared distribution stack with images.

Create immutable plugin config that matches schema2 requirements.

Ensure data being pushed is same as pulled/created.

Store distribution artifacts in a blobstore.

Run init layer setup for every plugin start.

Fix breakouts from unsafe file accesses.

Add support for `docker plugin install --alias`

Uses normalized references for default names to avoid collisions when using default hosts/tags.

Some refactoring of the plugin manager to support the change, like removing the singleton manager and adding manager config struct.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 3d86b0c79b16334ce5836c0315e4c310b84c2e17
Component: engine
2016-12-23 13:29:58 -08:00
9eac558235 Enforce zero plugin refcount during disable.
When plugins have a positive refcount, they were not allowed to be
removed. However, plugins could still be disabled when volumes
referenced it and containers using them were running.

This change fixes that by enforcing plugin refcount during disable.
A "force" disable option is also added to ignore reference refcounting.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 8cb2229cd18c53bdbf36301f26db565a50027d6a
Component: engine
2016-12-22 13:26:53 -08:00
35037b78fd Convert DanglingOnly to Filters for docker image prune
This fix convert DanglingOnly in ImagesPruneConfig to Filters,
so that it is possible to maintain API compatibility in the future.

Several integration tests have been added to cover changes.

This fix is related to 28497.

A follow up to this PR will be done once this PR is merged.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a6be56b54e871c4e7a6e72881770a64676c27c3c
Component: engine
2016-12-02 20:08:49 -08:00
c21adc5da9 Add HTTP client timeout.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 83ca993c154d56e03d6f95a3f8351c48b3ed3e29
Component: engine
2016-11-21 13:11:40 -08:00
2efd6e2078 Return warnings from service create and service update when digest pinning fails
Modify the service update and create APIs to return optional warning
messages as part of the response. Populate these messages with an
informative reason when digest resolution fails.

This is a small API change, but significantly improves the UX. The user
can now get immediate feedback when they've specified a nonexistent
image or unreachable registry.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 948e60691e523022f88e7f8129f02106a0f8826c
Component: engine
2016-11-18 09:31:31 -08:00
fadae43674 move plugins out of experimental
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: c410222e42fb9195909390337bc129c6481e2453
Component: engine
2016-11-10 15:51:32 -08:00
4d22d82151 api: Service Logs support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 819d0159bbda1b3ae53bdaa9a3e62ac98497e24c
Component: engine
2016-11-10 13:46:02 -08:00
0827ead1b6 Revise swarm init/update flags, add unlocking capability
- Neither swarm init or swarm update should take an unlock key
- Add an autolock flag to turn on autolock
- Make the necessary docker api changes
- Add SwarmGetUnlockKey API call and use it when turning on autolock
- Add swarm unlock-key subcommand

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 0f9fc54df9274327ed22f4e07f0981a648e0278a
Component: engine
2016-11-09 16:09:00 -08:00
2874df7efa Add support for swarm init lock and swarm unlock
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b4a667c8c4f536445d35e8914a58e8c749f16ea6
Component: engine
2016-11-09 16:09:00 -08:00
9dbbc071d5 secrets: secret management for swarm
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: use tmpfs for swarm secrets

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: inject secrets from swarm secret store

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: use secret names in cli for service create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

switch to use mounts instead of volumes

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vendor: use ehazlett swarmkit

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

secrets: finish secret update

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 3716ec25b423d8ff7dfa231a7b3cf0154726ed37
Component: engine
2016-11-09 14:27:43 -05:00
d0ebaa81e8 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>

update cobra and use Tags

Signed-off-by: Victor Vieux <vieux@docker.com>

allow client to talk to an older server

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: e98e4a71110fd33852bb755a9b8b4ebc9df904db
Component: engine
2016-11-08 04:55:27 -08:00
2c5782817e Generate ContainerWait response from the swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 181562c2e54225d6ce737d98b03d3157451a5dbc
Component: engine
2016-10-31 11:19:53 -04:00
bc7bcb9601 generate AuthResponse type from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2732b8a9bb3edb92121d0b0dcc144e5f557e2fbf
Component: engine
2016-10-31 11:16:03 -04:00
1b85879c03 Generate container update response from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f196cf6a090556ccb42198043a71d133482b510d
Component: engine
2016-10-31 11:16:02 -04:00
1759ab5e8b Use IDResponse for container create response.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c8d5e7203e1ae140a5cca312b6699063b521cf83
Component: engine
2016-10-31 11:16:02 -04:00
01541139a5 Add an IDResponse type
Generated from a swagger spec and use it for container exec response

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 01883c136d9ef06962d80aa81e27d1d90eb6d199
Component: engine
2016-10-31 11:16:02 -04:00
913e9a48c1 Generate container create response from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: bad849fc826b410c3aeb753a8c7f6b38f7ae12b0
Component: engine
2016-10-31 11:16:02 -04:00
dc10e9a664 Use a config to generate swagger api types
Moves the resposne types to a package under api/types

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 29df3bdb117a058ae040686dd0f2565ae9ad743a
Component: engine
2016-10-31 11:13:41 -04:00
d19255532a Generate VolumesCreateRequest from the swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5c2498fd3c41f4badb1788665886d30772537f73
Component: engine
2016-10-31 11:13:41 -04:00
31c5c30bb3 Generate VolumeList response from the swagger spec
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d459e83b1c993d63d5f94b85a7f8ddf3ac01beae
Component: engine
2016-10-31 11:13:41 -04:00