Commit Graph

115 Commits

Author SHA1 Message Date
402994850c restrict secret view to node level in controller
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 8392123f303e55902ac42544f0e7e226855592f6
Component: engine
2017-03-14 09:53:02 -04:00
5fe9aafe47 Merge pull request #31500 from dperny/fix-service-logs-cli
Add tail and since to service logs
Upstream-commit: 1d4608032d95b846418cdf6a718061d20fed7f48
Component: engine
2017-03-14 14:19:29 +01:00
e5626386d5 Add tail and since to service logs
This change adds the ability to do --tail and --since on docker service
logs. It wires up the API endpoints to each other and fixes some older
bugs. It adds integration tests for these new features.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 8dc437bd9b474c24a2cf802c2779dace2f91194a
Component: engine
2017-03-10 14:59:00 -08:00
218618324e Error on attempting service logs on TTY container
Right now getting logs from a service with an attached TTY does not
work. The behavior was undefined and caused the command to hang and
strange messages to occur in the daemon logs.

This returns errors, both deep in the swarmkit adapter (to guard against
undefined behavior, which is Bad) and in the daemon (to tell users that
the thing they're asking for is not possible).

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 37ae1ef0ffcf8605daeaf41440da774370377a6d
Component: engine
2017-03-10 14:48:56 -08:00
13f20b59db Merge pull request #30754 from yongtang/25696-stop-signal
Add `--stop-signal` for `service create` and `service update`
Upstream-commit: bb9f19503cbb0153a0da01b1e91691cd63f48dd9
Component: engine
2017-03-01 18:10:57 +01:00
3226daa36d Shutdown leaks an error when the container was never started
I found that sometimes tasks would end up in a rejected state when
trying to update them quickly. The problem was that Shutdown could fail
if called before the container was started. Instead of returning an
error in this case, Shutdown should succeed. This allows tasks to
progress to the "shutdown" state as expected.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 37b492ae1b2ba5f84cd0b795dbc68804d7b2fec5
Component: engine
2017-02-22 19:12:07 -08:00
5050030ffa Add --stop-signal for service create and service update
This fix tries to address the issue raised in 25696 where
it was not possible to specify `--stop-signal` for `docker service create`
and `docker service update`, in order to use special signal to stop
the container.

This fix adds `--stop-signal` and update the `StopSignal` in `Config`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 25696.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c2d49ec214649b0025f7060429334893350fbaee
Component: engine
2017-02-21 15:19:45 -08:00
c355cec53c Merge pull request #30457 from dmcgowan/distribution-reference-update-2
reference: use distribution reference and remove fork
Upstream-commit: 254fc83cba90ed79c78f4cb0cb33aeeaff492798
Component: engine
2017-02-07 22:01:25 +01:00
2260389fe6 Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3a1279393faf78632bf169619d407e584da84b66
Component: engine
2017-02-07 11:08:37 -08:00
e827e3506f Merge pull request #30197 from yongtang/30178-service-health-check-none
Fix issue where service healthcheck is `{}` in remote API
Upstream-commit: 09114fe9f0fcfaa97be46c3142b8b64aacc94571
Component: engine
2017-02-07 17:17:26 +01:00
0ba6f88a03 cluster/executor: check mounts at start
While it is important to not create controllers for an invalid task,
certain properties should only be checked immediately before use. Early
host validation of mounts prevents resolution of the task Executor when
the mounts are not relevant to execution flow. In this case, we have a
check for the existence of a bind mount path in a creation function that
prevents a task controller from being resolved. Such early validation
prevents one from interacting directly with a controller and result in
unnecessary error reporting.

In accordance with the above, we move the validation of the existence of
host bind mount paths to the `Controller.Start` phase. We also call
these "checks", as they are valid mounts but reference non-existent
paths.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 92899ffac8ca1136e807dd234e8fa1dd49db7801
Component: engine
2017-02-06 13:09:53 -08:00
9655371ac7 Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
Upstream-commit: 4c1b40b9d4a301edc5874e59edcec0f015490fec
Component: engine
2017-02-01 16:52:00 +01:00
2af5a366ad Add --read-only for service create and service update
This fix tries to address the issue raised in 29972 where
it was not possible to specify `--read-only` for `docker service create`
and `docker service update`, in order to have the container's root file
system to be read only.

This fix adds `--read-only` and update the `ReadonlyRootfs` in `HostConfig`
through `service create` and `service update`.

Related docs has been updated.

Integration test has been added.

This fix fixes 29972.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 499a0dd43e50c6f253f8890f5c54ae99675b1e7e
Component: engine
2017-01-30 12:47:26 -08:00
d9702930f2 Fix issue where service healthcheck is {} in remote API
This fix tries to address the issue raised in 30178 where
service healthcheck is `{}` in remote API will result in
dns resolve failue.

The reason was that when service healthcheck is `{}`,
service binding was not done.

This fix fixes the issue.

An integration test has been added.

This fix fixes 30178.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8feb5c5a48eaadc1686e3b370f7ef9be128dd3cb
Component: engine
2017-01-27 15:43:44 -08: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
d93ce12d04 Vendor swarmkit, containerd, and related dependencies
Update swarmkit to 037b491.

As swarmkit switched to a newer gRPC version, this also involves
updating Docker's vendored gRPC, which in turn requires updating
containerd to a new version that has protobufs generated against this
gRPC version.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 3e987e1732ee5c51e95934afabba3fedfd16c4af
Component: engine
2017-01-23 17:51:14 -08:00
775c5633ef *: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 7a855799175b6b984886ef1cfa337d6df1d4c668
Component: engine
2017-01-06 18:48:41 -08:00
7c2700ecf9 Remove redundant format
Signed-off-by: Ke Li <kel@splunk.com>

Add missing changes

Signed-off-by: Ke Li <kel@splunk.com>

User errors.New to create error

Signed-off-by: Ke Li <kel@splunk.com>
Upstream-commit: 514adcf4580effa4820be8d5e6d2c0ea9825ceb2
Component: engine
2016-12-27 21:46:52 +08: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
ce25e5f9c1 Publish installed v2 plugins to manager
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 2a97ea9a6e03443d4d10fd2f440feb779ab8699e
Component: engine
2016-12-14 17:02:56 -08:00
2ce45ea956 Fix missing IPAM options in swarm network mode
This fix tries to fix the issue raised in 29044 where
the IPAM options is missing in swarm network mode
after the service is deployed. Before the service
is deployed, the IPAM options is available.

The reason for the issue is that, before service is
deployed, `network inspect` is querying the swarm and
obtained the correct information.
However, after service is deployed, swarm executor
does not pass the IPAM options to the backend (daemon).
Also after service is deployed, `network inspect` is
actually querying the local daemon for information.
At this time the network information with missing IPAM
options is returned.

This fix fixes the issue by updating the swarm network
allocator and swarm executor.

A separate PR for swarmkit will be opened.

An integration test has been added to cover the change.

This fix fixes 29044.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4d958e99c178f7cd4196ed901c2834ae13f0f7d0
Component: engine
2016-12-10 09:29:50 -08:00
c46ac53d0a Remove hostname validation as it seems to break users
Validation is still done by swarmkit on the service side.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ef39256dfb711f8382a5c021b85d6c7d613282b0
Component: engine
2016-11-30 19:22:07 +01:00
d598152124 Merge pull request #28899 from aaronlehmann/dont-pull-image-id
Don't resolve or pull images referenced by ID
Upstream-commit: 768f4ce02b5a2a86ea100d0b875c5949ea652c7d
Component: engine
2016-11-30 10:08:43 +01:00
c0fecf9b2a Merge pull request #28721 from dongluochen/attachable_network
Fix network attachable option
Upstream-commit: 4fae94f6637bfbbeba809f930f2ecf1e36748882
Component: engine
2016-11-29 11:04:49 -08:00
bb120e07d5 Initialize field with name
Signed-off-by: Ke Li <kel@splunk.com>
Upstream-commit: da6944ec8747a50941c170186605c8cead517201
Component: engine
2016-11-29 19:36:56 +08:00
0e6be54ce9 Fix network attachable option.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: abcb699ad175859ee192388c001f55df5f88e8cd
Component: engine
2016-11-28 16:54:56 -08:00
4d8affc167 Don't resolve or pull images referenced by ID
If a swarm service is created using an image ID, it's useless to try to
pull this reference or resolve it to a manifest digest. Avoid doing this
when a fully qualified image ID is given.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 089842c4b47c262187b0b1a8d6d124f3faa03752
Component: engine
2016-11-28 13:53:52 -08:00
53a64e3bc4 Merge pull request #26833 from cpuguy83/use_mounts_api_for_services
Use container Mounts API for Swarm containers.
Upstream-commit: 04155250492c3fd75d2e789b6d2355636c8cf766
Component: engine
2016-11-22 22:48:54 +01:00
14f731c22d Use container Mounts API for Swarm containers.
Instead of converting nicely typed service mounts into untyped `Binds`
when creating containers, use the new `Mounts` API which is a 1-1
mapping between service mounts and container mounts.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 821aeb6a6f72f070ae045cb7813759cbbaba7bda
Component: engine
2016-11-22 13:23:51 -05:00
abd795e582 service logs: Support no-follow mode
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: c2d435e4f05d262aaa3d4d5cc2fe8965377eebdf
Component: engine
2016-11-21 18:02:13 -08:00
d9512c0fad do not force target type for secret references
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

use secret store interface instead of embedded secret data into container

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: bebd472e40cae91b548e983872a2665a5836ba43
Component: engine
2016-11-17 15:49:02 -05:00
e846f5ae11 Add support for stdin_open in composefile v3
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 84450b72cd73161449bae16b8ad0010fcc4a07eb
Component: engine
2016-11-11 15:19:00 +01:00
840ea93170 Merge pull request #27917 from mrjana/ports
Add support for host port PublishMode in services
Upstream-commit: a5da9f5cc911da603a41bb77ca1ccbb0848d6260
Component: engine
2016-11-10 19:38:54 -08:00
128844d475 Merge pull request #28265 from aaronlehmann/dont-repull-digest
executor: Don't repull image if pinned by digest
Upstream-commit: 1229105582ff8a05493637e709e46edf2061c0c1
Component: engine
2016-11-10 19:19:31 -08:00
b688822593 Add support for host port PublishMode in services
Add api/cli support for adding host port PublishMode in services.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: 14ac9f60d0174256e0713701ebffaf5ca827da71
Component: engine
2016-11-10 18:07:55 -08:00
ca36766d89 Merge pull request #27998 from dnephin/compose-on-swarm
Support `docker stack deploy` from a Compose file
Upstream-commit: 750d634d62689bf45ecbb4ae34094ad6a5a7fce5
Component: engine
2016-11-10 17:59:57 -08:00
3213314d62 Merge pull request #28031 from yongtang/27902-extra-hosts
Add flag `--host` to `service create` and `--host-add/rm` to `service update`
Upstream-commit: bed96ce922da5fa9df98b826ff0e4ad4bf375a31
Component: engine
2016-11-10 16:55:29 -08:00
147fe85462 executor: Don't repull image if pinned by digest
If the image reference in the spec uses a digest, and an image with that
digest already exists locally, avoid an unnecessary repull.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: f69e5c18ac1186af96a75918fc60f0b8e5ae7675
Component: engine
2016-11-10 14:45:54 -08:00
e93ab8dcb4 cluster executor: Logs retrieving support.
Plumbed the executor to the container logs backend.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 0ec68657139f029e2740780a58e0019df0e42b6a
Component: engine
2016-11-10 12:02:47 -08:00
6e2afbaf59 Add flag --host to service create and --host-add/--host-rm to service update
This fix tries to address 27902 by adding a flag `--host`
to `docker service create` and `--host-add/--host-rm` to
`docker service update`, so that it is possible to
specify extra `host:ip` settings in `/etc/hosts`.

This fix adds `Hosts` in swarmkit's `ContainerSpec` so that it
is possible to specify extra hosts during service creation.

Related docs has been updated.

An integration test has been added.

This fix fixes 27902.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ea9a23ccdbd3a861e4cfa3441482b448fd1c17a5
Component: engine
2016-11-10 10:20:24 -08:00
3a6b62c164 Add integration test for stack deploy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: eefccc25c5cda96947978c503d5764aa48aacd7d
Component: engine
2016-11-10 11:28:18 -05:00
38597e8d2b Fix hostname support for compose file
Pass the hostname from ContainerSpec to the actual container.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d0117238fa74ea75cdec7b9205620c59bafc4508
Component: engine
2016-11-10 11:28:18 -05:00
174f2a0d72 Merge pull request #28025 from vdemeester/swarm-mode-templating
Add support for swarm mode templating
Upstream-commit: 8ffd1a370c447db92a67d17f900ccd453dbcedee
Component: engine
2016-11-09 15:57:52 -08:00
9549c6b9d6 Add support for swarm mode templating
Wire templating support of swarmkit for the engine, in order to be used
through services.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6212ea669b4e92b3aa3985857f827ee9b95271fd
Component: engine
2016-11-09 23:28:06 +01:00
5907fa959f more review updates
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: eff36b7d669a8d0dbb9d79b70f9cb1f8a6ffdbd8
Component: engine
2016-11-09 14:27:45 -05:00
e093728442 review updates
- use Filters instead of Filter for secret list
- UID, GID -> string
- getSecrets -> getSecretsByName
- updated test case for secrets with better source
- use golang.org/x/context instead of context
- for grpc conversion allocate with make
- check for nil with task.Spec.GetContainer()

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: b2e4c7f3b5b30fc6940768ec41836d708a48b463
Component: engine
2016-11-09 14:27:45 -05:00
e9ea5a5560 update to support new target in swarmkit
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 88dea0e06e0e94a8ab4cb5fe852e26bff309261a
Component: engine
2016-11-09 14:27:44 -05:00
45bc21e90e update to support latest swarm changes
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: f50a65ff0c28618f798d06838e36b015dd022b45
Component: engine
2016-11-09 14:27:43 -05:00
848c015ac1 more review updates
- use /secrets for swarm secret create route
- do not specify omitempty for secret and secret reference
- simplify lookup for secret ids
- do not use pointer for secret grpc conversion

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 189f89301e0abfee32447f2ca23dacd3a96de06d
Component: engine
2016-11-09 14:27:43 -05:00
dde21cf7dc review changes
- fix lint issues
- use errors pkg for wrapping errors
- cleanup on error when setting up secrets mount
- fix erroneous import
- remove unneeded switch for secret reference mode
- return single mount for secrets instead of slice

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 857e60c2f943a09e3ec0ac0f236821b797935900
Component: engine
2016-11-09 14:27:43 -05:00