Commit Graph

844 Commits

Author SHA1 Message Date
59db12afbb rename clusterProvider to cluster in router
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0238e9e92bd8a2bdc805578b18bc342b1c482a85
Component: engine
2016-12-26 20:53:13 +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
e6fc7a5576 Merge pull request #29599 from anusha-ragunathan/refcount
Enforce zero plugin refcount during disable, not remove.
Upstream-commit: d1dfc1a5ef95dc5621a07915f9786199442043c7
Component: engine
2016-12-22 15:38:54 -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
209ed6b4ef change minor mistake of spelling
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 7c3657065cc04af278a0f1cee99de8c2401ba0ef
Component: engine
2016-12-20 21:05:19 +08:00
4a0adf4beb update response status code for cluster request
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 29d4a7f512e3702ee4a2871dd84e3b24dd26477d
Component: engine
2016-12-19 10:21:10 +08:00
8616ae37b9 Merge pull request #29423 from unclejack/api_cli_integ_return
return directly without ifs in remaining packages
Upstream-commit: 21210419447281863f239805ab19248733041a52
Component: engine
2016-12-17 21:30:47 +01:00
1f59facb6e api: allow creating a network of which name is the prefix of the ID of a swarm network
Previously, it doesn't allow creating such a network:

e.g.

    $ docker network inspect -f '{{.Id}}' ingress
    84xh9knigj6zyt00u31e26nj3
    $ docker network create 84
    Error response from daemon: network with name 84 already exists

Fix #27866

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: edfbc3b8767ab2e89e73ba3142d2ddad295001e9
Component: engine
2016-12-15 15:09:06 +00:00
d363742779 return directly without ifs in remaining packages
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 2c187a24e0003f2f0ab90b85876e668f2b6210d4
Component: engine
2016-12-14 23:28:27 +02:00
b5155284d2 Merge pull request #29104 from duglin/Issue29084
Fix processing of unset build-args during build
Upstream-commit: dca76ed50a02659ba7ca4e209356f138ff14dc3e
Component: engine
2016-12-07 17:18:55 -08:00
e048bb17f7 Merge pull request #29139 from ehazlett/fix-api-cors-exec
Add headers when using exec
Upstream-commit: a039ca9affe5fa40c4e029d7aae399b26d433fe9
Component: engine
2016-12-07 17:10:31 -08:00
ce009b27d8 Fix processing of unset build-args during build
This reverts 26103.  26103 was trying to make it so that if someone did:
  docker build --build-arg FOO .
and FOO wasn't set as an env var then it would pick-up FOO from the
Dockerfile's ARG cmd.  However, it went too far and removed the ability
to specify a build arg w/o any value. Meaning it required the --build-arg
param to always be in the form "name=value", and not just "name".

This PR does the right fix - it allows just "name" and it'll grab the value
from the env vars if set. If "name" isn't set in the env then it still needs
to send "name" to the server so that a warning can be printed about an
unused --build-arg. And this is why buildArgs in the options is now a
*string instead of just a string - 'nil' == mentioned but no value.

Closes #29084

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: cdb8ea90b04683adb25c8ccd71b6eaedc44b51e2
Component: engine
2016-12-07 07:41:55 -08:00
425efc088a add headers when using exec
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

ensure headers are properly sanitized

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: f86db80b5ff3250a98482b4dc9ff69effbbf2390
Component: engine
2016-12-06 14:27:34 -05:00
92a14fe836 Merge pull request #28535 from yongtang/28497-prune-until
Convert DanglingOnly to Filters for `docker image prune`
Upstream-commit: 745795ef2e0089c5001e5a2fc7ba8c1ab0234857
Component: engine
2016-12-06 11:03:45 +01:00
3c2896d350 Merge pull request #28963 from vieux/refactor_plugin_install
refactor plugin install
Upstream-commit: 1c96879f1e99efc881aaa3480bc6aab18d233475
Component: engine
2016-12-05 12:00:29 -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
c0aa09b760 Merge pull request #28988 from vdemeester/28985-dont-validate-hostname
Remove hostname validation as it seems to break users
Upstream-commit: 3cb310c21049f652dd00d20899cb1ece1ee9aa8f
Component: engine
2016-12-02 21:16:56 -05:00
a9f58f81fd refactor plugin install
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: fa3b61a28f55d84afbbb978785ce9632123d12fa
Component: engine
2016-12-02 15:23:08 -08:00
c2f7699391 Merge pull request #28917 from erxian/correct-secret-remove-http-return-code
correct the http return code of secret remove
Upstream-commit: 457d562af128a765b48389681399903ca0e679cf
Component: engine
2016-11-30 22:47:28 +01: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
cfe1223c49 correct the http return code of secret remove
Signed-off-by: erxian <evelynhsu21@gmail.com>
Upstream-commit: 21768933fbf61d1481e303ee7a3a5ecc57fc3838
Component: engine
2016-11-30 19:45:45 +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
50f0cb2e24 AcceptedFilters in router/network/filter.go should not be exported
It's not used elsewhere and doesn't need to be exported.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e517d7975eb7e4dec8326b181e5fcc81b7871575
Component: engine
2016-11-28 14:14:50 +01:00
08d6a8b3d7 Merge pull request #28691 from aluzzardi/service-logs-no-follow
[experimental] service logs: Support no-follow mode
Upstream-commit: c025d5650433de503f0b415b7b5e120cfcd35b17
Component: engine
2016-11-22 13:48:14 -08:00
419cdb27d7 Merge pull request #28595 from anusha-ragunathan/plugin_timeout
Allow HTTP client timeout to be configurable on plugin enable.
Upstream-commit: 677e14643c79184ca9d8123dd3e91e0444b1cac3
Component: engine
2016-11-22 10:17:10 -08:00
3aef405305 Merge pull request #28529 from allencloud/update-secret-create-url
fix secret create url for consistency
Upstream-commit: 772a423e08d6da2dbfebb22382270ea9d075a9a9
Component: engine
2016-11-22 09:55:17 -08: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
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
36b43dcc24 api: types: keep info.SecurityOptions a string slice
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 514ca09426e5d023753101ffa6ac3a21b0e0efb5
Component: engine
2016-11-19 13:21:16 +01:00
68a4c9aae2 Merge pull request #28524 from aluzzardi/experimental-routes
router: Return explicit error rather than 404 for experimental.
Upstream-commit: c3fab6d47345f0d79efd88d0ea0495dd70f0e9f5
Component: engine
2016-11-18 18:49:15 -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
5d1129c013 fix typo
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 1f039a66ac55c937f5dfa281a04009626d191f83
Component: engine
2016-11-18 15:51:36 +08:00
b0d2847574 update secret create url for consistency
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 86d768284303665bf137ac4766a623167a605c76
Component: engine
2016-11-18 10:18:21 +08:00
84fb1a0844 router: Return explicit error rather than 404 for experimental.
Instead of not adding experimental routes at all, fail with an explicit
message if the daemon is not running in experimental mode.

Added the `router.Experimental` which does this automatically.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 3976a33c1a578827da3726bec3927cc058fe326a
Component: engine
2016-11-17 15:51:47 -08:00
ba96408498 Merge pull request #28532 from stevvooe/disabled-swarm-service-unavailable
api/server/httputils: service unavailable for disable swarm
Upstream-commit: bbac9eeae68a2d1084961dc3b0adc4e9e729647c
Component: engine
2016-11-17 15:16:23 -08:00
e3739bc965 Merge pull request #28383 from zteBill/fix-useless-var
Remove needless var
Upstream-commit: 6969c98a3c9ca90616d88c6a57543ccd5724e6fb
Component: engine
2016-11-17 16:18:07 -05:00
781fc7e6b4 api/server/httputils: service unavailable for disable swarm
When swarm-mode is disabled, we need to return an error indicating this.
406 was chosen for the "Not Acceptable" verbiage, but this code has
specific semantics in relation to the `Accept` header, which aren't
applicable here.

We now use a 503 for this case. While it is not a perfect match, it does
make it clear that the particular "service" (read: API endpoint) is not
available. The body of the message provides the user with enough
information to take action on it by enabling swarm-mode and ensuring the
service is available.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 1d90d7604881e29b71819af9c092d565513aeeec
Component: engine
2016-11-17 11:43:45 -08:00
2b31c00bf1 make each return explicitly
Signed-off-by: zteBill <bi.zhenkun@zte.com.cn>
Upstream-commit: 4b3a1bbda5613ee12d4e94f7797fca51139109a6
Component: engine
2016-11-17 17:13:25 +08:00
1d59d8efa7 Merge pull request #28530 from stevvooe/derandom-error-codes
api/server/httputils: ensure consistent status code
Upstream-commit: e93bd7b8ce01802df25bb83af801a2a45c148cc4
Component: engine
2016-11-16 23:52:52 -08:00
3c5187452a api/server/httputils: ensure consistent status code
Error code resolution is powered by string matching. Not the greatest
thing in the world and I hope no one is proud of this code, but it
works. However, because a map is used, the iteration order of the map is
random, such that if an error matches two of the snippets, it may return
a different error code depending on the seed of the hashmap. This change
converts it to use a slice instead.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 3484e02590117d175d9c1ab24c583390b4e94a55
Component: engine
2016-11-16 18:58:55 -08:00
e75f2fc3c8 Add reference filter and deprecated filter param…
… for `docker images`.

This deprecates the `filter` param for the `/images` endpoint and make a
new filter called `reference` to replace it. It does change the CLI
side (still possible to do `docker images busybox:musl`) but changes the
cli code to use the filter instead (so that `docker images --filter
busybox:musl` and `docker images busybox:musl` act the same).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 820b809e70df8b9c7af00256182c48d935972a5c
Component: engine
2016-11-11 15:34:01 +01:00
1a60835f0f rectify type defination for swarmRouter
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: ac5d86a672c9b46f2c26540690fcbd92c25715dc
Component: engine
2016-11-11 10:45:48 +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
62ec0be101 Merge pull request #28164 from anusha-ragunathan/plugin-build
Add plugin create functionality.
Upstream-commit: 28a1ea342d1f227664ad30ffd05eaaab8c9ef93e
Component: engine
2016-11-09 17:49:51 -08:00
2394a196a1 Add unlock key rotation
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: a6030a50c95cd4e8b39b5f4d5705bb23ebdb28c5
Component: engine
2016-11-09 16:09:01 -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
3e9922773f Merge pull request #28078 from sanimej/inspect
Show peer nodes in network inspect for swarm overlay networks
Upstream-commit: 5ef5a4216a83421122461c90b7aa1ca1d709c4c8
Component: engine
2016-11-09 15:33:13 -08:00
948055475e Add plugin create functionality.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 5b6e1bc9e551ba56b44c3f409fd5d48f8a54ce1d
Component: engine
2016-11-09 15:23:03 -08:00
6c7506b25f Show peer nodes in network inspect for swarm overlay networks
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Upstream-commit: dd9944aa644c717009a85ab85e00894ef3d3b20f
Component: engine
2016-11-09 13:58:04 -08:00