Commit Graph

858 Commits

Author SHA1 Message Date
bc911a640c Merge pull request #28409 from dnephin/swagger-gen-more
Generate more types from the swagger spec
Upstream-commit: a69c4129e086e4e7b86cce7d2682685dfdc6f2d2
Component: engine
2017-01-26 10:35:34 -08:00
a818254bf8 Fix incorrect Scope in network ls/inspect with duplicate network names
This fix tries to address the issue raised in 30242 where the `Scope`
field always changed to `swarm` in the ouput of `docker network ls/inspect`
when duplicate networks name exist.

The reason for the issue was that `buildNetworkResource()` use network name
(which may not be unique) to check for the scope.

This fix fixes the issue by always use network ID in `buildNetworkResource()`.

A test has been added. The test fails before the fix and passes after the fix.

This fix fixes 30242.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 05a831a775be5e8d752deaef620e629deb15cb89
Component: engine
2017-01-25 09:39:55 -08:00
c28bd5178d Merge pull request #29965 from yongtang/29946-networks-api
Return `[]` instead of `null` in case `filterNetworks` returns empty
Upstream-commit: f19a293dd741583c66001799435f784f2af455e0
Component: engine
2017-01-17 18:58:35 +01:00
c249c5ced8 Don't use AutoRemove on older daemons
Docker 1.13 moves the `--rm` flag to the daemon,
through an AutoRemove option in HostConfig.

When using API 1.24 and under, AutoRemove should not be
used, even if the daemon is version 1.13 or above and
"supports" this feature.

This patch fixes a situation where an 1.13 client,
talking to an 1.13 daemon, but using the 1.24 API
version, still set the AutoRemove property.

As a result, both the client _and_ the daemon
were attempting to remove the container, resulting
in an error:

    ERRO[0000] error removing container: Error response from daemon:
    removal of container ce0976ad22495c7cbe9487752ea32721a282164862db036b2f3377bd07461c3a
    is already in progress

In addition, the validation of conflicting options
is moved from `docker run` to `opts.parse()`, so
that conflicting options are also detected when
running `docker create` and `docker start` separately.

To resolve the issue, the `AutoRemove` option is now
always set to `false` both by the client and the
daemon, if API version 1.24 or under is used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0ea7b143b0a8366799c83a955be676aaf1345214
Component: engine
2017-01-15 01:59:57 +01:00
6fcadc8e19 Return [] instead of null in case filterNetworks returns empty
This fix tries to address the issue raised in 29946 where
listing networks from API will return `null` if the result of
network filter is empty.

The reason for the issue was that inside the `filterNetworks()`,
the return value was initialized as `nil`:
```
 var typeNet []types.NetworkResource
```

This is inconsistent with other places where return value was
initialized with `[]`
```
displayNet := []types.NetworkResource{}
```

This fix addresses the issue by changing `typeNet` to `[]` as well.

This fix fixes 29946.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 6ae709bf10e97c0a0ad8aebb9075f59eaea97ba9
Component: engine
2017-01-11 01:56:11 -08:00
0c3b3bfadc Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment
https://github.com/docker/docker/pull/28535#issuecomment-263215225

This fix provides `--filter until=<timestamp>` for `docker container/image prune`.

This fix adds `--filter until=<timestamp>` to `docker container/image prune`
so that it is possible to specify a timestamp and prune those containers/images
that are earlier than the timestamp.

Related docs has been updated

Several integration tests have been added to cover changes.

This fix fixes #28497.

This fix is related to #28535.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 58738cdee327f5de481dcf7d3d377374cbb5f13a
Component: engine
2017-01-04 14:16:42 -08:00
f43a9bc718 Convert ContainerTopOKResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 16bdbaaa3357dc1be7d74a283a3ed8d0d861a461
Component: engine
2017-01-03 11:47:47 -05:00
c049133b66 Generate ImageDeleteResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5988b84e4fd9a512e3e8f98b3cfd7c030a4f013e
Component: engine
2017-01-03 11:47:47 -05:00
0a6e02b356 Generate ImageHistory from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b462c93edb44790ca309e3721950cb23be5d7d62
Component: engine
2017-01-03 11:47:44 -05:00
6b3d2b6135 Merge pull request #28631 from likel/master
Don't do format if it's unnecessary
Upstream-commit: d6be0e98027611cfb14a3246ca797bee0936e649
Component: engine
2016-12-30 01:13:12 +01:00
82cdad076c fail fast when network filter invalid
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: ee2925e2f970a83581aadd08704b117b09377d23
Component: engine
2016-12-29 17:34:53 +08:00
96e9f269ff Merge pull request #29666 from tonistiigi/client-deps
Clean up client binary dependencies
Upstream-commit: bf6eb855391e166a65db284567686fafbe4a9a0a
Component: engine
2016-12-27 15:01:24 -05: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
98d422fce0 Move UAStringKey to dockerversion pkg
Removes grpc dependency from client

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 64981b9f095459ae65954ca80a86c8f4a735ef24
Component: engine
2016-12-26 18:53:22 -08:00
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