Commit Graph

2868 Commits

Author SHA1 Message Date
f4e4bf60ab api: Only return a Platform when relevant information is available
I noticed that we could return a Platform that has no information filled
in. This doesn't look like it would cause any problems, but it would be
confusing. Fix the handler to only append to this slice when the
Platform is not empty.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: df86a14af21539422f667ae33601a4f24f21e574
Component: engine
2017-05-17 18:42:16 -07:00
5f22605796 support cluster events
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: 59d45c384a2de7bca73296ce1471646db14cb0c8
Component: engine
2017-05-17 11:46:30 -07:00
774fa5cacd Merge pull request #33237 from aaronlehmann/oci-types
api: Use OCI types for Digest and Platform
Upstream-commit: 77c9728847358a3ed3581d828fb0753017e1afd3
Component: engine
2017-05-17 02:40:11 +02: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
0e311d1c4e Merge pull request #33151 from nwt/push-foreign-layers
Add daemon option to push foreign layers
Upstream-commit: a30ef99e8dd2c3e7a54b6410a5709f61db59c07f
Component: engine
2017-05-17 02:04:31 +02:00
caabf0e2ac Merge pull request #32388 from nishanttotla/pin-by-digest-on-client-alternative
Moving docker service digest pinning to client side
Upstream-commit: d6f4fe9e38b60f63e429fff7ffced9c26cbf8236
Component: engine
2017-05-16 15:24:07 -07: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
3f22cbeb2a Update Container Wait Backend
This patch consolidates the two WaitStop and WaitWithContext methods
on the container.State type. Now there is a single method, Wait, which
takes a context and a bool specifying whether to wait for not just a
container exit but also removal.

The behavior has been changed slightly so that a wait call during a
Created state will not return immediately but instead wait for the
container to be started and then exited.

The interface has been changed to no longer block, but instead returns
a channel on which the caller can receive a *StateStatus value which
indicates the ExitCode or an error if there was one (like a context
timeout or state transition error).

These changes have been propagated through the rest of the deamon to
preserve all other existing behavior.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: cfdf84d5d04c8ee656e5c4ad3db993c258e52674
Component: engine
2017-05-16 15:09:14 -07:00
a57be1e4d4 api: Use OCI types for Digest and Platform
The current use of the types from distribution brings in some
unfortunate dependencies, including other distribution packages and the
gorilla/mux and gorilla/context packages. Using the OCI types avoids
the extra dependencies for client users.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 309f99edae5849327ab9c3ec9335b42ba5612202
Component: engine
2017-05-16 14:54:23 -07:00
67b57727bd Add daemon option to push foreign layers
The --allow-nondistributable-artifacts daemon option specifies
registries to which foreign layers should be pushed.  (By default,
foreign layers are not pushed to registries.)

Additionally, to make this option effective, foreign layers are now
pulled from the registry if possible, falling back to the URLs in the
image manifest otherwise.

This option is useful when pushing images containing foreign layers to a
registry on an air-gapped network so hosts on that network can pull the
images without connecting to another server.

Signed-off-by: Noah Treuhaft <noah.treuhaft@docker.com>
Upstream-commit: 67fdf574d5acd6ddccb6ece0ffe0ace1c1608712
Component: engine
2017-05-16 14:36:36 -07:00
4dacea7efb Merge pull request #33144 from nishanttotla/update-swarmkit-platform-structs
Adding Platforms field to TaskSpec Placement
Upstream-commit: 7b7f9a481e21e740263cb43baae9473d888afcba
Component: engine
2017-05-16 15:22:03 -04: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
7030b36d75 Merge pull request #33190 from zhangxiaoyu-zidif/format-for-server
server.go: format for
Upstream-commit: 6ef7afce83fd24b61d22cbf0e12e03ae0116b706
Component: engine
2017-05-16 01:28:04 +02:00
6ca0a8eece Adding Platforms field to TaskSpec
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 1efbe6e8761370bbe8c136928a68323c7d8dbecf
Component: engine
2017-05-15 14:58:20 -07: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
a1d5efdf77 server.go: format for
Signed-off-by: zhangxiaoyu-zidif <zhang.xiaoyu33@zte.com.cn>
Upstream-commit: 1ab62a0b4daa6b643fc140d3ec8661ef407ec3b1
Component: engine
2017-05-15 07:12:28 +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
d7fd55d70a Merge pull request #32993 from cyli/root-rotation-cli
API changes to rotate swarm root CA
Upstream-commit: eb8abc95985bf3882a4a177c409a96e36e25f5b7
Component: engine
2017-05-12 10:12:32 -07:00
a16746fe29 Merge pull request #33164 from thaJeztah/add-secret-to-service-create-example
Add "secrets" example for service create API docs
Upstream-commit: 12458662495e7c8f63e4f86e8a7207403ab82957
Component: engine
2017-05-11 23:42:58 -04:00
8a6877a0a3 Merge pull request #33166 from thaJeztah/fix-secret-response-example
Fix secret/{id} response example
Upstream-commit: 6e83ef6ad6d12d5952649bd3645a5d2b6ea2b80b
Component: engine
2017-05-11 23:42:04 -04:00
dbf4ba7522 Propagate the desired CA certificate and CAConfig ForceRotate parameter
in the Docker REST APIs when viewing or updating the swarm spec info, and
also propagate the desired CA key in the Docker REST APIs when updating
swarm spec info only (it is not available for viewing).

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: 1847bb899a07d3dd324e75a3ed9b3489fcfc302f
Component: engine
2017-05-11 10:22:42 -07:00
42c7989190 Add config APIs
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 772855768785ce678751795c168e056a8db35d09
Component: engine
2017-05-11 10:08:21 -07:00
34d74ed853 Fix secret/{id} response example
Fixes a warning that was shown;

    Warning: Other properties are defined at the same level as $ref at
    "#/paths/~1secrets~1{id}/get/responses/200/schema". They are IGNORED according
    to the JsonSchema spec

That resulted in the example not being
rendered in the documentation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f3bcea00cd0de1f874728142babd7b10b379cf15
Component: engine
2017-05-11 18:02:19 +02:00
841ec601d8 Add "secrets" example for service create API docs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3e7c1b9a99a0e86abac00fbda87d3d961c1fa0f5
Component: engine
2017-05-11 17:46:10 +02:00
2c6473821e Merge pull request #33054 from dnephin/refactor-builder-named-contexts-interface
[Builder] Expose GetImage interface for builder
Upstream-commit: 974cec945b80bc0004f3917ec318c15e9c038e4a
Component: engine
2017-05-11 11:03:30 -04:00
c1ba295763 Merge pull request #32875 from cyli/root-ca-info-in-api
Propagate TLS Info in swarm info and node info REST endpoints
Upstream-commit: f02a5b50c407bdb087388e18e1ac619f2788dd8d
Component: engine
2017-05-11 00:35:46 +02:00
df464dbe2f Refactor imageContexts into two different structs.
buildStages now tracks the imageID and runConfig for a build stage

imageMounter tracks image mounts so they can released when the build ends.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6c28e8edd5f047d5b1438f773d49882f28d7a006
Component: engine
2017-05-10 17:59:30 -04:00
e526b1e1d8 Expose a smaller interface for the Builder retrieving images from daemon
Removes 3 methods from the builder.Backend interface
Remove the coupling between imageContexts, imageMounts and the builder.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b3bc7b28d09138a37ab5476eb46dfe74f8984f18
Component: engine
2017-05-10 17:58:57 -04:00
89f4e9426e Merge pull request #32061 from nishanttotla/engine-api-manifest
Adding Docker API endpoint to inspect image manifest
Upstream-commit: 28d428f4ec3ae218f9466d69ad7d0f53c1f3575b
Component: engine
2017-05-10 23:43:30 +02:00
2bc4204935 Propagate the swarm cluster and node TLS info provided by the swarm
objects into the REST API responses.  In the CLI, display only
whether the nodes' TLS info matches the cluster's TLS info, or
whether the node needs cert rotation.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: 64cccedbce86542fc9289ad9cca1dd758f2f21c2
Component: engine
2017-05-10 11:29:17 -07:00
817f36020a Adding example to /distribution/{name}/json endpoint swagger spec
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 4a812040eb14a8e2a6aeeb7686d19e8ef81f29cd
Component: engine
2017-05-10 11:20:03 -07:00
34899cbe9c /distribution/{name}/json returns full Descriptor object
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 12e232ee35b56cb2954c48d83ec9febb40cdeb90
Component: engine
2017-05-09 17:25:27 -07:00
d16e6f29c5 Merge pull request #32877 from chchliang/unittest
add testcase with api/errors/errors_test.go
Upstream-commit: 6b3801858c7aec2c2170a9c9a9a8651d071b1549
Component: engine
2017-05-09 09:42:08 +02:00
9657e321b1 Adding /distribution/{name}/json endpoint to contact registry
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 41b27de41b8b0e034bfe2a3c73b2bc6ff98c7ceb
Component: engine
2017-05-08 16:58:38 -07:00
20ec9814c7 Merge pull request #32978 from thaJeztah/fix-network-list-example
Update description and example for network-list endpoint
Upstream-commit: afd7e2d2d5ba506205fcc6501d4479c7e2706f50
Component: engine
2017-05-08 15:14:55 +02:00
7e3625db1c Update description and example for network-list endpoint
As of API 1.28, the network-list endpoint no longer
returns a list of containers attached to each network.

This patch updates the example response, and adds
a note to the description.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fedb3b8884aea996e3a5c4fa7ccda2f931bb545a
Component: engine
2017-05-05 10:36:48 -07:00
bd17f42bef Add docker build --iidfile=FILE
This is synonymous with `docker run --cidfile=FILE` and writes the digest of
the newly built image to the named file. This is intended to be used by build
systems which want to avoid tagging (perhaps because they are in CI or
otherwise want to avoid fixed names which can clash) by enabling e.g. Makefile
constructs like:

    image.id: Dockerfile
    	docker build --iidfile=image.id .

    do-some-more-stuff: image.id
    	do-stuff-with <image.id

Currently the only way to achieve this is to use `docker build -q` and capture
the stdout, but at the expense of losing the build output.

In non-silent mode (without `-q`) with API >= v1.29 the caller will now see a
`JSONMessage` with the `Aux` field containing a `types.BuildResult` in the
output stream for each image/layer produced during the build, with the final
one being the end product.  Having all of the intermediate images might be
interesting in some cases.

In silent mode (with `-q`) there is no change, on success the only output will
be the resulting image digest as it was previosuly.

There was no wrapper to just output an Aux section without enclosing it in a
Progress, so add one here.

Added some tests to integration cli tests.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Upstream-commit: 5894bc1abf8186802d360d20739b57bfffed51df
Component: engine
2017-05-05 16:35:54 +01:00
bd96b9098d Merge pull request #32951 from wsong/patch-2
Add a proper type to the Source field in Mount
Upstream-commit: 118d4ee1230119c1e0be4b9946593916d85ca386
Component: engine
2017-05-04 17:09:25 -07:00
ed9c3799a0 Merge pull request #32946 from cpuguy83/add_logdrivers_to_info_api_doc
Add swagger spec for /info Log plugins
Upstream-commit: 865a5fd5e3baec65dd221610d2817cddd75eeb4b
Component: engine
2017-05-04 09:20:51 -04:00
0046c26e1e Merge pull request #32949 from dnephin/refactor-streamformatter-and-progress
Refacator pkg/streamformatter
Upstream-commit: 08d7fad45dce832dc03934e9f4fc904899220c96
Component: engine
2017-05-03 09:05:26 -07:00
755f9321e1 Refacator pkg/streamformatter
StreamFormatter suffered was two distinct structs mixed into a single struct
without any overlap.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c87d67b0ad788a6a80d1af89488e2d1f22726c34
Component: engine
2017-05-02 17:38:12 -04:00
063319b6e1 Add swagger spec for /info Log plugins
The `Log` field for plugins was added to `/info` in
17abacb8946ed89496fcbf07a0288fafe24cb7b0 but the swagger spec was not
updated.
This just updates the spec to match reality.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 146e058592b472522824ac28e4b75184eb24358b
Component: engine
2017-05-02 14:42:41 -04:00
0694cd9f02 Add a proper type to the Source field in Mount
This field was missing a type, which meant that the example objects that Swagger tools generate did not work.

Signed-off-by: Wayne Song <wsong@docker.com>
Upstream-commit: 7a9583693154881f33be7c1b3ba089cdc0dca37f
Component: engine
2017-05-02 09:39:52 -07:00
5259fb7c17 add testcase with api/errors/errors_test.go
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
Upstream-commit: f157b54606899057360be60ec0e4826d8382c12b
Component: engine
2017-05-02 17:03:31 +08:00
dbcc3f98b6 Cleanup all the mutate + defer revert of b.runConfig in the builder
Instead of mutating and reverting, just create a copy and pass the copy
around.

Add a unit test for builder dispatcher.run

Fix two test failures

Fix image history by adding a CreatedBy to commit options. Previously the
createdBy field was being created by modifying a reference to the runConfig that
was held from when the container was created.

Fix a test that expected a trailing slash. Previously the runConfig was being
modified by container create. Now that we're creating a copy of runConfig
instead of sharing a reference the runConfig retains the trailing slash.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9f738cc574d50d0a2accdf6f6deb30405c24a80c
Component: engine
2017-05-01 18:36:53 -04:00
3d193f829d Extract squash and tagging from the Dockerfile builder.
Remove pathCache and replace it with syncmap
Cleanup NewBuilder
Create an api/server/backend/build
Extract BuildTagger

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0296797f0f39477d675128c93c1646b3186937ee
Component: engine
2017-05-01 12:07:32 -04:00
9c221aedcb Minor grammatical fix
Just a small grammatical correction, but it is unnecessary to repeat "to," after the colon, and deleting it makes the format of the list more consistent and readable.

Signed-off-by: Ryan Cooper <ryan.cooper7@gmail.com>
Upstream-commit: 5cd75dd14cd6427470c3812dd7ccc7095a30a243
Component: engine
2017-05-01 03:30:27 -06:00
a016bc7a76 Merge pull request #32894 from davidxia/patch1
[docs] Add missing Name field to NetworkContainer object
Upstream-commit: 6d7ae1fa0bb7b2cf2cd9ee9fce2b06cceb3aeb5b
Component: engine
2017-04-28 18:28:31 -07:00
8a2cc25685 Merge pull request #32828 from cyli/external-ca-cert
Add the `CACert` parameter to the `ExternalCA` object
Upstream-commit: 25058d9b0c1414a0c7fa1aef5dd1766aaf2e1c30
Component: engine
2017-04-28 10:30:57 -04:00