Commit Graph

109 Commits

Author SHA1 Message Date
d4e814fc0e Merge pull request #29337 from anusha-ragunathan/unmount_enable_err
When plugin enable fails, unmount PropagatedMount.
Upstream-commit: e9076c0f00898e7af05e667d65ecb84a6e15d9c8
Component: engine
2016-12-12 16:02:16 -08:00
5710a52064 When plugin enable fails, unmount PropagatedMount.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: cef443bddf2a185b3afa2f5c7333fd461c87ae74
Component: engine
2016-12-12 13:25:06 -08:00
e31c4556e5 Merge pull request #29230 from vieux/remove_old_media_type_plugin
remove old media type compat for plugins
Upstream-commit: 8de2336f078af8467900e0c6591e5732755733bc
Component: engine
2016-12-12 12:43:32 -08:00
6b1a2692bb Merge pull request #26398 from tiborvass/plugin-fixes
plugins: container-rootfs-relative paths
Upstream-commit: 0a072e93df6ad10e37bbf0b1f540fff7b7581a75
Component: engine
2016-12-09 12:48:59 -08:00
482b3af442 Merge pull request #29281 from anusha-ragunathan/fix_race
Fix race in setting plugin refcounts.
Upstream-commit: 86a0de7fa9fe34d29cffc8fcffe0b81b0db78a87
Component: engine
2016-12-09 12:47:39 -08:00
656f60dc73 plugins: container-rootfs-relative paths
Legacy plugins expect host-relative paths (such as for Volume.Mount).
However, a containerized plugin cannot respond with a host-relative
path. Therefore, this commit modifies new volume plugins' paths in Mount
and List to prepend the container's rootfs path.

This introduces a new PropagatedMount field in the Plugin Config.
When it is set for volume plugins, RootfsPropagation is set to rshared
and the path specified by PropagatedMount is bind-mounted with rshared
prior to launching the container. This is so that the daemon code can
access the paths returned by the plugin from the host mount namespace.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: c54b717caf1a55e525ce180bfcb42addd59c6633
Component: engine
2016-12-09 10:16:24 -08:00
955998db83 Fix race in setting plugin refcounts.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 4c088d1e2ebfcc384a365734017988f4fd1c4605
Component: engine
2016-12-09 09:34:30 -08:00
5b4ba9313b Merge pull request #28949 from yongtang/28717-docker-plugin-create
Use GetByName to check for collision before create any context in plugin creation
Upstream-commit: 9d884986f5c001cacb60aa3c50036575ed2dd22d
Component: engine
2016-12-09 09:12:08 -08:00
d377a823f5 Merge pull request #29244 from yuexiao-wang/fix-typos-eg
Fix a bit typos
Upstream-commit: d1515a5264e7872bfe11543b2b23b4f1eac23f68
Component: engine
2016-12-09 16:03:35 +09:00
aacf384e2f Merge pull request #28459 from dmcgowan/plugin-repository-pinning
Plugin repository pinning
Upstream-commit: c1a1b381f91367afa94a69649d9aa808acecc8ac
Component: engine
2016-12-08 11:28:52 -08:00
795fc21c8b Fix a bit typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 11454e1c97ed5495e77a06868a0c199d81aa96c3
Component: engine
2016-12-09 03:05:11 +08:00
a09c35f1e8 Merge pull request #29191 from anusha-ragunathan/plugin_races
Make v2/Plugin accesses safe.
Upstream-commit: 9d898b872ebe953cab1b60366253f1a9210764cc
Component: engine
2016-12-07 17:52:44 -08:00
c7e69feeb2 remove old media type compat for plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: f644e758bd58f7b045a52b29038ae0043b0c9e3d
Component: engine
2016-12-07 17:35:09 -08:00
3889503c60 Make v2/Plugin accesses safe.
v2/Plugin struct had fields that were
- purely used by the manager.
- unsafely exposed without proper locking.
This change fixes this, by moving relevant fields to the manager as well
as making remaining fields as private and providing proper accessors for
them.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: b35490a8ba2ad70a585c1ba8109b6d87aece8daa
Component: engine
2016-12-06 13:23:41 -08:00
37fb30ac29 Fix docker inspect <unkown object> issue on Windows
This fix tries to address the issue raised on 29185 where
`docker inspect <unknown object>` on Windows will return:
```
Error response from daemon: plugins are not supported on this platform
```

The reason was that in case `--type` is not specified, `docker inspect`
will iterate through different types `container`, `image`, `network`,
`plugin` etc. The `plugin` object is the last type to check.

However, as `plugin` is not supported on Windows yet, the error message
is not very informative for `plugins are not supported on this platform`.

This fix tries to fix the issue by return a `not found` error on unsupported
platforms as well.

An integration test has been added to cover the changes for Windows/Linux.

This fix fixes 29185.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 88fcdb0a825da040ef2b1f9c191af480f0f2cc90
Component: engine
2016-12-06 12:05:59 -08: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
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
8d0b8ac112 Support plugins in docker inspect
This fix tries to address the proposal raised in 28946
to support plugins in `docker inspect`.

The command `docker inspect` already supports
"container", "image", "node", "network", "service", "volume", "task".
However, `--type plugin` is not supported yet at the moment.

This fix address this issue by adding the support of `--type plugin`
for `docker inspect`.

An additional integration test has been added to cover the changes.

This fix fixes 28946.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 90bb2cdb9f15a9b1b9a4e2ea4242882665daac4e
Component: engine
2016-12-02 11:33:29 -08:00
2ac57c6dcf Allow docker plugin inspect to search based on ID or name
This fix tries to address the issue raised in discussion of
PR 28735 where it was not possible to manage plugin based on
plugin ID. Previously it was not possible to invoke
`docker plugin inspect` with a plugin ID (or ID prefix).

This fix updates the implementation of `docker plugin inspect`
so that it is possbile to search based on a plugin name, or a
plugin ID. A short format of plugin ID (prefix) is also possible,
as long as there is no ambiguity.

Previously the check of `docker plugin inspect` was mostly done
on the client side. This could potentially cause inconsistency
between API and CMD. This fix move all the checks to daemon side
so that API and CMD will be consistent.

An integration test has been added to cover the changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0ce6e070f7d1e4b1b478d52b4464f8480dbfd9b7
Component: engine
2016-12-01 10:44:17 -08:00
cb6219042e Use GetByName to check for collision before create any context in plugin creation
This fix is a follow up to the comment:
https://github.com/docker/docker/pull/28717#discussion_r90040589

Currently, the collision checking is done at the last step `Add()` of
plugin creation. However, at this stage the context such as plugin
directories have already been creation. In case of name collision,
rollback is needed which could be expensive.

This fix performs the check at the beginning of CreateFromContext using
GetByName. In this way, collision fails fast and no context creation
or rollback is needed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 52405a9b5896fd1c3ea6d8b1ca1c70e5979e3271
Component: engine
2016-11-29 14:18:01 -08:00
7517d3b3a5 Merge pull request #28717 from yongtang/28684-duplicate-docker-plugin-create
Fix issue caused by duplicate `docker plugin create` with same names
Upstream-commit: 82b35dd997f46ff430cb084c962089c40f5bc96a
Component: engine
2016-11-29 08:22:40 -08:00
8b9cbd5ed5 Merge pull request #28893 from anusha-ragunathan/delete_onerr
On plugin pull errors, delete created dirs.
Upstream-commit: c1b0f23de0953e3d36cdd3b510cf6da4ebea6f76
Component: engine
2016-11-29 14:48:27 +01:00
fbf2916db8 On plugin pull errors, delete created dirs.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 9e4234261c3e4d13f98218a97d7cc6644723e310
Component: engine
2016-11-28 16:57:27 -08:00
c7fce8b04c Fix issue with plugin exit.
A plugin has an `ExitChan` channel which is used to signal the exit of
the plugin process. In a recent change, the initialization was
incorrectly moved to the daemon Shutdown path.

Fix this by initializing the channel during plugin enable.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 890a98ceed982454515f5b089d9772fc1e4eb6e0
Component: engine
2016-11-28 12:48:56 -08:00
c06179cb55 Fix issue caused by duplicate docker plugin create with same names
This fix tries to fix the issue raised in 28684:
1. Duplicate plugin create with the same name will override the old plugin reference
2. In case an error happens in the middle of the plugin creation, plugin directories
   in `/var/lib/docker/plugins` are not cleaned up.

This fix update the plugin store so that `Add()` will return an error if a plugin
with the same name already exist.

This fix also will clean up the directory in `/var/lib/docker/plugins` in case
an error happens in the middle of the plugin creation.

This fix fixes 28684.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 662d456928e47162a3af5931356cb05b6a3f9918
Component: engine
2016-11-28 12:37:49 -08:00
e746d79ff3 Merge pull request #28601 from tiborvass/plugin-misc-fixes
Plugin miscellaneous fixes
Upstream-commit: 23ea9e45fd6281e82c389e6112457a7bb70f8d89
Component: engine
2016-11-22 16:12:37 -08:00
8236c4e19a plugins: misc fixes
Rename variable to reflect manifest -> config renaming
Populate Description fields when computing privileges.
Refactor/reuse code from daemon/oci_linux.go

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 6547609870b66f9dfb1894a4987c42608f856f3e
Component: engine
2016-11-22 14:32:07 -08:00
051270420d plugins: support for devices
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 53b9b99e5cd19d9913c56c07276a2d4d83b9befd
Component: engine
2016-11-22 09:54:45 -08:00
47bad37f72 Add class to repository scope
Expose registry error translation for plugin distribution

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: a12b466183e03621bc9e1c1e4deab6db8ec93f0a
Component: engine
2016-11-21 22:18:50 -08:00
f460bac81d plugins: do not try to contact disabled plugin
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 84e58e2f89b3dea30738f92edcabef4336d0cff6
Component: engine
2016-11-21 14:52:14 -08:00
4ae83fca35 plugins: support for host networking
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 99124c055ac5d145737fe432ffc2e62e320d3d96
Component: engine
2016-11-21 14:52:14 -08:00
14aacd334b plugins: linux capabilities and device creation
In the plugin manifest, Capabilities has been moved to
Linux.Capabilities to avoid confusion with Interface.Types[i].Capability

A DeviceCreation boolean has also been added to the manifest. This could
be changed in the future to be specific to a major number.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 9f239281b1b02ed46f98af1eb39bc9b2165073fa
Component: engine
2016-11-21 14:52:14 -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
c148947fe6 fix a few golint errors
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: 9c559e6d0b7190b4698de59e692a047beba017fd
Component: engine
2016-11-18 18:32:02 -08:00
9b39de5905 Merge pull request #28512 from anusha-ragunathan/fix_enable
Cleanup after plugin install.
Upstream-commit: a58e3e7fefd67ebe57c183e970e5fcda096c9ad1
Component: engine
2016-11-17 10:16:47 +01:00
6f5b54ba77 Cleanup after plugin install.
During error cases, we dont cleanup correctly. This commit takes care
of removing the plugin, if there are errors after the pull passed. It
also shuts down the plugin, if there are errors after the plugin in the
enable path.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 1144f8f1d4b1fd2bbf1f41bf5dad8d929d0dc06e
Component: engine
2016-11-16 14:45:51 -08:00
9f2af5ec1b explicitly show plugins as unsupported on !linux
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: a8139460ff98b081c06ecf28a821d6f456d9a079
Component: engine
2016-11-15 16:47:30 -08:00
195add3182 Perform graceful shutdown during plugin disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 766cc9b46753106c6880ccdea0a4dcb2bc734c2a
Component: engine
2016-11-14 15:09:48 -08:00
b0b2a12b08 update media_type
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 970b23db2e97e1671c6bf4b57bfe5d1a30e98819
Component: engine
2016-11-10 15:51:32 -08:00
a5ddd33ae3 support mounts, devices and args for docker plugin set
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: fc7a2652588ed30e3b3a10ab72329e82f0440236
Component: engine
2016-11-10 11:55:48 -08:00
6949dd3368 rename plugin manifest
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 49ca91fbebbea80587ce3c0814bba3b41cce14a0
Component: engine
2016-11-10 00:09:23 -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
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
5a46073d11 Merge pull request #28086 from vieux/delete_rootfs_plugin
delete plugin rootfs on `docker plugin rm`
Upstream-commit: 4b63ad33ec77dbf15879da8ce8a7870d58f562bd
Component: engine
2016-11-08 17:03:01 -08:00
2153863109 delete plugin rootfs on plugin rm
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 586b7cc19ef289b0f60a859ca75ec6a9eb97120d
Component: engine
2016-11-08 03:30:37 -08:00
9254ca1e2c Merge pull request #27923 from vieux/plugin_set_gogogo
support env for docker plugin set
Upstream-commit: 03da822ee9afa1713fe28c3996b0872a0e228c28
Component: engine
2016-11-07 17:07:14 -08:00
a773a75547 support env for docker plugin set
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: efbed4500e30ff1a0eef4ff71fd46a58363d041b
Component: engine
2016-11-07 16:59:29 -08:00
6fb90ed484 Add functional support for Docker sub commands on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 934328d8ea650bf8a9c3c719999ce2a1f5dd5df6
Component: engine
2016-11-07 09:06:34 -08:00
60d0e46ea2 Merge pull request #27924 from vieux/prevent_panic_volume_plugin_disable
prevent panic when docker build & volume plugin is disabled
Upstream-commit: cc8b8ce0b3d2d6b3345687464d3a3b1c2c4971ef
Component: engine
2016-11-01 14:57:52 -07:00
07a831dfc2 Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

Fixed issue #23459

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: fa710e504b0e3e51d4031790c18621b02dcd2600
Component: engine
2016-10-31 22:05:01 -06:00