Commit Graph

961 Commits

Author SHA1 Message Date
f4101eb2fb return prune data when context canceled
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 87b4dc2002d50e245f432bbd97e9dee2db25cf96
Component: engine
2017-07-10 10:06:24 +08: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
ec1ee882b3 Merge pull request #33322 from jsoref/spelling
Spelling
Upstream-commit: ff4f700f74450018f36d014f3cde0ff1b9c17fb3
Component: engine
2017-07-04 15:46:34 +02:00
3fea46b7b2 Merge pull request #33884 from aaronlehmann/redact-secret-payload
middleware: Redact secret data on "secret create"
Upstream-commit: b9f248d0ea9f7ec4e0325c7034038319c70c2dda
Component: engine
2017-07-03 14:18:32 -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
ab5c937cf4 Merge pull request #33824 from ijc/build-iidfile-with-squash
builder: Emit a BuildResult after squashing.
Upstream-commit: b8766fe793c18149e167b8f9819352a3bfcb0514
Component: engine
2017-06-30 16:42:23 +02:00
c71c867f51 middleware: Redact secret data on "secret create"
With debug logging turned on, we currently log the base64-encoded secret
payload.

Change the middleware code to redact this. Since the field is called
"Data", it requires some context-sensitivity. The URI path is examined
to see which route is being invoked.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 3fbc352cbbce06cd3001d6b14b2b1ebcb4d42cd5
Component: engine
2017-06-29 16:04:47 -07:00
9a5747b3f9 LCOW: Fix nits from 33241
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4ec9766a27ffb964cec6b8b2745725965b2644aa
Component: engine
2017-06-27 11:59:49 -07:00
1c2b78478c builder: Emit a BuildResult after squashing.
This ensures that the final BuildResult is the actual tagged image.

Fixes #33822.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Upstream-commit: 9777ec3be0e3056d0bedcf36052704f832e45759
Component: engine
2017-06-26 13:19:25 +01:00
aaa2288536 Merge pull request #33798 from vdemeester/move-some-api-code-away
Move some `api` package functions away
Upstream-commit: d311a3a681f918906249a1678eab0136ac663f6e
Component: engine
2017-06-24 14:30:25 +02:00
cbfdedc6bd Move some api package functions away
- DisplayablePorts is a `cli` function, moving to `docker/cli`
- Move MatchesContentType to the only package using it,
  `api/server/httputils` (and remove the deps on logrus for `api` package)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 565aa41392b01251dfc9398eb69c23bdd8ea64e6
Component: engine
2017-06-23 19:37:26 +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
9541d17c29 LCOW: Plumb through platform on Import
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3d5cec70b4432866e4c290e9fc601571ca09da9d
Component: engine
2017-06-20 19:49:54 -07:00
094f300460 LCOW: pull goes to correct stores
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: a1fe1dc791633998bcc82b5f0734a5da68d2bb41
Component: engine
2017-06-20 19:49:52 -07:00
3af9801344 LCOW: Move daemon stores to per platform
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3aa4a0071536d3b106374eaa44d8a55765901aa6
Component: engine
2017-06-20 19:49:52 -07:00
8c7c972d20 Merge pull request #33454 from dnephin/refactor-builder-remove-copy-on-build
[Builder] Move file coping from the daemon to the builder
Upstream-commit: 99c72eb2682c0539ad3cc544eb28876af78b33a1
Component: engine
2017-06-20 10:12:57 +02:00
c832750e54 Remove Go 1.6 code from moby
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 6bfd0f6b5d08bcd609da11947432ad0f3aa3d8fd
Component: engine
2017-06-19 15:59:00 +03:00
b687d7ca5a Merge pull request #33630 from yongtang/167-cli-network-inspect-scope
Add `scope` filter in `GET /networks/(id or name)`
Upstream-commit: 4310f7da7e6bcd8185bf05e032f9b7321cfa6ea2
Component: engine
2017-06-12 18:27:24 -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
83a1ff66bd Suggest login on pull denial
Signed-off-by: Alfred Landrum <alfred.landrum@docker.com>
Upstream-commit: 8d9f51ea55c8c9373d20bcc7561ca34c59aaf8c2
Component: engine
2017-06-09 12:43:21 -07:00
c9920c89e8 Merge pull request #33609 from thaJeztah/backport-29418
backport #29418 "Fix buildIpamResources()" to master
Upstream-commit: c9f26eaaf8b9f7977319d6d596f8701bbc58a108
Component: engine
2017-06-09 19:18:50 +02:00
758ca586cf Merge pull request #29418 from aboch/p66
[1.13.x] Fix buildIpamResources()
(cherry picked from commit 4d2be03b68dd54d8f2307e8b4178ad8ed8d5d343)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 27498a3c60018ea2880a18beec65710fd27971a7
Component: engine
2017-06-09 13:51:43 +02:00
13d2adae3f Fix copy when used with scratch and images with empty RootFS
Commit the rwLayer to get the correct DiffID
Refacator copy in thebuilder
move more code into exportImage
cleanup some windows tests
Release the newly commited layer.
Set the imageID on the buildStage after exporting a new image.
Move archiver to BuildManager.
Have ReleaseableLayer.Commit return a layer
and store the Image from exportImage in the local imageSources cache
Remove NewChild from image interface.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 51360965206b0db49cc0365dabb590063a17a9df
Component: engine
2017-06-08 15:07:16 -04:00
9244630a6b choose rpc code to determine status code
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: f257f77c6c13ee851d3b899f8d51628a5dec92db
Component: engine
2017-06-06 10:08:50 +08:00
dbc4b6c5bd Do not log the CA config CA signing key in debug mode.
Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: d60f18204978d438d1eb336512576d47991c8ac1
Component: engine
2017-05-31 18:15:33 -07:00
cc72dd2445 Stop referring CLI flags in error messages if API client is unknown
Signed-off-by: Stanislav Bondarenko <stanislav.bondarenko@gmail.com>
Upstream-commit: 92291a7355dff35be70b5d0ebf634f0232ca6a94
Component: engine
2017-05-22 18:50:49 -04:00
ddd4203548 Merge pull request #33261 from aaronlehmann/empty-platform
api: Only return a Platform when relevant information is available
Upstream-commit: f888a25ff5bc9bb7c95400ec19b9a5fa0d738bab
Component: engine
2017-05-19 20:05:07 +02:00
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
eefcf59562 Allow to control network scope
- User can now promote a network's scope to swarm,
  so that the network is visible to swarm

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: fcafc7108b7b7f2ca9c2982b29b47de424f2da52
Component: engine
2017-05-17 15:50:28 -07:00
9f01da606a Support configuration networks
- They are configuration-only networks which
  can be used to supply the configuration
  when creating regular networks.
- They do not get allocated and do net get plumbed.
  Drivers do not get to know about them.
- They can be removed, once no other network is
  using them.
- When user creates a network specifying a
  configuration network for the config, no
  other network specific configuration field
  is are accepted. User can only specify
  network operator fields (attachable, internal,...)

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 9ee7b4dda926a1444dc0ea50c4ca6d90c8684060
Component: engine
2017-05-17 15:50:28 -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
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
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
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
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
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
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
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
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
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
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
3b753edcdd Merge pull request #31984 from tonistiigi/remote-context
builder: Refactor remote context
Upstream-commit: ae0f8c7ba16362e869894e0121cf3052069d7fe4
Component: engine
2017-04-27 11:50:18 -04:00
aadacb3d07 Refactor remote context parsing
Redefine a better interface for remote context dependency.

Separate Dockerfile build instruction from remote context.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: d1faf3df27207af111daf4bd0191478c374dbc55
Component: engine
2017-04-25 14:35:31 -07:00
50fe474af4 Honor context cancellation when pruning
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 0dee69799eb467543dc2ae4cc3bb7b46bc7e21d4
Component: engine
2017-04-24 09:11:29 -07:00
31ab70fb42 Honor context within SystemDiskUsage
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: cf7d246ab0d848cbc673f7c2d57031aecacacdfe
Component: engine
2017-04-24 09:11:29 -07:00