Commit Graph

324 Commits

Author SHA1 Message Date
0e21058181 Merge pull request #31631 from aaronlehmann/swarm-failure-on-startup
cluster: Proceed with startup if cluster component can't be created
Upstream-commit: 9b33edfa7e1f8fcd32b1c19120bc591ae22a5a8f
Component: engine
2017-03-22 16:40:49 -07:00
996aa3fb64 Merge pull request #31820 from ehazlett/secrets-restrict
Restrict secret view to node level in controller
Upstream-commit: 0fe41cc4db65372f66d79721344522159c173ae5
Component: engine
2017-03-17 14:25:32 +01:00
f6bac49560 Support --filter mode=global|replicated for docker service ls
This fix tries to address the request in 31325 by adding
`--filter mode=global|replicated` to `docker service ls`.

As `docker service ls` has a `MODE` column by default, it is natural
to support `--filter mode=global|replicated` for `docker service ls`.

There are multiple ways to address the issue. One way is to pass
the filter of mode to SwarmKit, another way is to process the filter
of mode in the daemon.

This fix process the filter in the daemon.

Related docs has been updated.

An integration test has been added.

This fix fixes 31325.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 43a1bd564b5dbd835631cda102f68286c0d533e9
Component: engine
2017-03-15 11:06:57 -07:00
7f033bf36d Merge pull request #31586 from aaronlehmann/digest-pin-context
cluster: Renew the context after communicating with the registry
Upstream-commit: 08bbd434f55e7468cb4363c60c5533b37875cf03
Component: engine
2017-03-14 09:46:15 -07:00
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
3f4d5e9ab5 Merge pull request #31713 from nishanttotla/better-warnings
Improve warnings when image digest pinning fails
Upstream-commit: 764e80e84c8cd72cf7843deda18c07760b5533a9
Component: engine
2017-03-13 17:57:06 -07:00
7e6d323f9b Improve warnings when image digest pinning fails
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 44855dff42a4adbf73a4d286e27963da2112f563
Component: engine
2017-03-13 15:16:35 -07:00
1b786f2dda Merge pull request #31674 from dperny/service-logs-err-on-tty
Error on attempting services logs on TTY container
Upstream-commit: 47615d9871510cdad0f894f8bc9e82c1a9873fa5
Component: engine
2017-03-13 10:17:33 -07: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
e92d0c63e0 cluster: Fix shadowed resp variable
The response would never reach the client because it was being
redeclared in the current scope.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 9d127f8de3fa489b2c0d896dd9612f43e45f7cdd
Component: engine
2017-03-09 17:58:12 -08:00
8c76bad868 Merge pull request #30856 from allencloud/make-secret-update-support-name-and-id-prefix
make secret update support name and id prefix
Upstream-commit: d4a8c3b438cb8ae95916fee3e7fac93639b720f6
Component: engine
2017-03-08 12:31:44 +01:00
642bdd2e30 cluster: Proceed with startup if cluster component can't be created
The current behavior is for dockerd to fail to start if the swarm
component can't be started for some reason. This can be difficult to
debug remotely because the daemon won't be running at all, so it's not
possible to hit endpoints like /info to see what's going on. It's also
very difficult to recover from the situation, since commands like
"docker swarm leave" are unavailable.

Change the behavior to allow startup to proceed.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: f7d846094a5dc642198cc4939df646a3e889a750
Component: engine
2017-03-07 16:50:39 -08:00
f7cd555009 Fix dropped field in task translation from GRPC to REST
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 497c4f05b931a7f64785543922b19e94362607e6
Component: engine
2017-03-07 14:55:15 -08:00
569aaf9edd Merge pull request #31265 from cyli/remove_swarm_subdirs
Rather than remove the swarm directory and re-create, remove the subdirs
Upstream-commit: fd5f9d7941287cbbaeecfd16e0159508b3f6af63
Component: engine
2017-03-07 14:30:34 -05:00
4340eba05a make secret update support name and id prefix
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9d30525a04e2d4efe51ac9e6c114ce36276aafa8
Component: engine
2017-03-07 16:01:21 +08:00
ec64fef8e0 cluster: Renew the context after communicating with the registry
When pinning by digest, the registry might be slow or unresponsive. This
could cause the context to already be expired by the time UpdateService
or CreateService is called. We want digest pinning to be a best-effort
operation, so it's problematic if a slow or misbehaving registry
prevents the service operation from completing. Replace the context
after communicating with the registry, so we have a fresh timeout for
the gRPC call.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: f8273a216ed35e22ac157dee8055393f07d4be39
Component: engine
2017-03-06 16:05:56 -08:00
d82df5d4ba Implement server-side rollback, for daemon versions that support this
Server-side rollback can take advantage of the rollback-specific update
parameters, instead of being treated as a normal update that happens to
go back to a previous version of the spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: f9bd8ec8b268581f93095c5a80679f0a8ff498bf
Component: engine
2017-03-03 16:33:34 -08:00
ac66308e6c Add support for rollback flags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 3a88a24d23e6eb1ca521cd9ab6e306d4ba1c1464
Component: engine
2017-03-03 16:33:34 -08:00
0c390668f1 Add support for the "rollback" failure action
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: cc9d04647a68cf49e66bf26f10908387b99dae1a
Component: engine
2017-03-03 16:33:34 -08:00
47709fd338 Merge pull request #31083 from xulike666/fight-for-readability
fix some typos from module contrib to man
Upstream-commit: 57fd478169071b09f0e6657cc1c2568d80c1bed3
Component: engine
2017-03-03 15:13:01 +01:00
d4d27bb5d4 Merge pull request #30725 from aaronlehmann/topology
Topology-aware scheduling
Upstream-commit: 3a5a1c3f3d1638c35891ee630ba20eda0bef560f
Component: engine
2017-03-03 15:01:12 +01:00
2b8ba501aa Rather than remove the swarm directory and re-create, remove the swarm subdirs
Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: 68506bd23998cb229e05f70e3e923f64c43b2526
Component: engine
2017-03-01 11:56:39 -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
27f6b8793b Add a lockedManagerAction method to Cluster…
… in order to remove duplication.
Each time we update a cluster object, we do some common
operations (lock, verify it's on a manager, get the request context,
and the update). This introduce a method and refactor few
update/remove method that allows to duplicate less code.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 250e05e42773a875d2fb8248b94fa72f2934a4b6
Component: engine
2017-02-28 11:12:11 +01:00
8b38b2a363 Refactor endpoint*FromGRPC to limit duplication
endpointSpecFromGRPC and endpointFromGRPC do the exact same thing for
endpoint{,Spec}.Ports, let's extract that to a method.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a620c0172c6f11c538b27a26fdb3e5cdd3bf2ff9
Component: engine
2017-02-28 10:51:55 +01:00
e64cb1f6c5 Remove daemon.VXSubnets duplicate code
Refactor daemon.V4Subnets and daemon.V6Subnets to limit duplication

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3c5932086af51f57c497690ce3cf18a906b700cf
Component: engine
2017-02-28 10:51:40 +01:00
737f03c444 Topology-aware scheduling
This adds support for placement preferences in Swarm services.

- Convert PlacementPreferences between GRPC API and HTTP API
- Add --placement-pref, --placement-pref-add and --placement-pref-rm to CLI
- Add support for placement preferences in service inspect --pretty
- Add integration test

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 17288c611a4f3f75ecb3bbb4533820b1836c55a6
Component: engine
2017-02-27 13:29:54 -08:00
1d2d461e40 Fix service logs API to be able to specify stream
Before this change, doing service logs was just tossing the stream
selectors and always using the default (both streams). This change adds
a check for which streams the user wants and only includes those.

Fixes #31306

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: f63c62ce70d6ed4706dbde43feb22c6004c32061
Component: engine
2017-02-23 15:09:09 -08: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
cdf7829892 fix some typos from module contrib to man
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: e0577d5fe876ec92de21c808c31e97e052654223
Component: engine
2017-02-18 10:08:55 +08:00
7b79f78433 Merge pull request #30967 from adshmh/24631-service-without-labels-returns-empty-map
Inspect output on service without labels is an empty map instead of null, fixes #24631
Upstream-commit: 0de867b315ff5734530558319b1f20238c81ba0c
Component: engine
2017-02-17 08:49:32 -08:00
6224d25ac6 Release the network attachment on allocation failure
- otherwise the attachment task will stay in store and
  consume IP addresses and there is no way to remove it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 91820b69412e2ec9e5b3201cd5c637ca1352fd39
Component: engine
2017-02-16 05:21:06 -08:00
f78660f63c Fixing #24631, inspect output on swarm object types without labels is empty object {}
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 1b347cfc795407ced5eae60cb3ceadfdab8a8f4f
Component: engine
2017-02-15 01:25:55 -05:00
fe42bb3c56 create a new file swarm.go and move swarm part code from cluster.go into swarm.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 75a315d43e2577768ba5e0ef071ed9631e43ce8b
Component: engine
2017-02-12 02:54:07 +08:00
5257b3c3b3 create a new file networks.go and move network part codes from cluster.go into networks.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 4f4151bba4eac6b6e4b47a922346fbf66120a057
Component: engine
2017-02-12 02:50:17 +08:00
767050f4bc create a new file task.go and move task part codes from cluster.go into tasks.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6be675c752ac511c7397fef5928af7dfda13a234
Component: engine
2017-02-12 02:45:00 +08:00
b538436290 create a new file services.go and move service part codes from cluster.go into services.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 6ff14b48c789fa9cad050b039b08f52491955ce2
Component: engine
2017-02-12 02:43:23 +08:00
6c9be69cc1 create a new file nodes.go and move node part codes from cluster.go into nodes.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 7591e313a4799074cee45dab43f40b583a959abb
Component: engine
2017-02-12 02:36:09 +08:00
31a98bbb56 refactor helper.go and move getSecret to helper.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: b6fb3a56dca43f33ddbb0b38a0fc0596c8c80b46
Component: engine
2017-02-12 02:30:53 +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
77ca635469 Merge pull request #30633 from vdemeester/29809-fix-network-ipam-configuration-on-master
Follow-up of 29826 Use default driver for IPAM if none
Upstream-commit: 829ea91bd16c006facf2948cab89302ef2db7306
Component: engine
2017-02-01 17:53:49 +01: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
42f5ad3701 Use default driver for IPAM if none
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c3220641274bb99e120a1b3dd64078f02589717b
Component: engine
2017-02-01 15:54:56 +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