Commit Graph

89 Commits

Author SHA1 Message Date
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
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
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
062853d1d4 prevent plugin when volume plugin is disabled
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 34f4b197b8cec5b177797e343a5c89473ff1d2aa
Component: engine
2016-10-31 17:59:45 -07:00
0befe9514a Fix stack overflow in ErrInAdequateCapacity.
fmt package formats an error by calling its Error() method.
This results in recursion. Fix this. Also remove dead code.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 4db753c0174420152957224d38fb6e8b6ae6908e
Component: engine
2016-10-28 10:02:48 -07:00
e24e6d4206 Merge pull request #27467 from tonistiigi/attach-cb
Move stdio attach from libcontainerd backend to callback
Upstream-commit: 8ed31089c03c36954e95c2066b1f3724e2d5c849
Component: engine
2016-10-25 16:23:07 +02:00
9a299b360f Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 7781a1bf0fef748877326632b88e92fbf3c90daa
Component: engine
2016-10-24 15:20:01 -07:00
1883869e16 Move stdio attach from libcontainerd backend to callback
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 37a3be2449d2a314305615ffcc287a598a829dba
Component: engine
2016-10-24 00:20:36 -07:00
56af301200 Merge pull request #27287 from mavenugo/pluginv2-sk2
Allow multiple handlers to support network plugins in swarm-mode 
Upstream-commit: 2c620d0aa24c5f774a9115449a86b158b005bba8
Component: engine
2016-10-20 13:43:04 -07:00
c651955564 Add plugin API version.
This version is across all plugin types and it versions the actual RPC
API between the daemon and the plugin.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 110e9733904682e416eb7397dd9cbf09805af29c
Component: engine
2016-10-18 09:07:16 -07:00
1050d22554 Allow plugins to have multiple handlers
Currently the plugins pkg allows a single handler. This assumption
breaks down if there are mutiple listeners to a plugin of a certain
Manifest such as NetworkDriver or IpamDriver when swarm-mode is enabled.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: 5e9c78aeaf1d88000921190b88a1d91d6261208c
Component: engine
2016-10-17 09:00:17 -07:00
effa6f4094 Update plugingetter import path in docker/docker.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: a98be0344b24d71235c17a87ff425f3d602e48e8
Component: engine
2016-10-11 11:24:18 -07:00
6363780a38 Remove restartmanager from plugins
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a452d1fccb6d515545dacd4bebfa36cbf70a6535
Component: engine
2016-10-07 12:10:13 -07:00
434bea436a Remove hacked Windows OCI spec, compile fixups
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 02309170a5fb97d40260d0ee9e24b44be8c780b2
Component: engine
2016-09-27 12:07:35 -07:00
fe313a4545 Add Handle method to plugingetter.
This is necessary for IPAM and network plugins.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: b3bd7f80afea51d42d3bd2d194d36a6852a7d51f
Component: engine
2016-09-26 11:06:26 -07:00
f07146ebf8 Make graphdrivers work with pluginv2.
As part of making graphdrivers support pluginv2, a PluginGetter
interface was necessary for cleaner separation and avoiding import
cycles.

This commit creates a PluginGetter interface and makes pluginStore
implement it. Then the pluginStore object is created in the daemon
(rather than by the plugin manager) and passed to plugin init as
well as to the different subsystems (eg. graphdrivers, volumedrivers).
A side effect of this change was that some code was moved out of
experimental. This is good, since plugin support will be stable soon.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: fefea805e930a67fb6327f8e59415932861358cb
Component: engine
2016-09-20 08:49:48 -07:00
ca8908a3a8 add check plugin is not used before rm
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: b22d07f51573e39069b4e3a6d8b0580958412e72
Component: engine
2016-09-15 13:50:57 -07:00
92f94b6c20 correct some nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9279a93f6d43da4c904eeb0adb249fdfa34f7f92
Component: engine
2016-09-15 12:17:58 +08:00
7bef93723c Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
Upstream-commit: d8fef66b03c1ea8715470690efbd950033f7f628
Component: engine
2016-09-08 21:31:52 -04:00
45ddc4bfcb Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 91e197d614547f0202e6ae9b8a24d88ee131d950
Component: engine
2016-09-07 11:05:58 -07:00
2f08c46e47 Adding pluginv2 support for libnetwork (part 1)
Legacy plugins (aka pluginv1) calls in libnetwork are replaced with
calls using the new plugin model (aka pluginv2). pkg/plugins is still
used for managing the http client connections to the plugin.

This commit makes the necessary changes in docker/docker. Part 2 will
will take care of the libnetwork changes.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 17b8aba1d924e505563af400d758b89c8406961d
Component: engine
2016-09-06 14:30:55 -07:00
ec70ce176c Reorganize plugin package into sub packages.
Split plugin package into `store` and `v2/plugin`. Now the functionality
is clearly delineated:
- Manager: Manages the global state of the plugin sub-system.
- PluginStore: Manages a collection of plugins (in memory and on-disk)
- Plugin: Manages the single plugin unit.

This also facilitates splitting the global PluginManager lock into:
- PluginManager lock to protect global states.
- PluginStore lock to protect store states.
- Plugin lock to protect individual plugin states.

Importing "github.com/docker/docker/plugin/store" will provide access
to plugins and has lesser dependencies when compared to importing the
original monolithic `plugin package`.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 27a55fba28ff9c085385254cb69ecc8ea6891aa9
Component: engine
2016-08-27 11:08:08 -07:00
67ccfbdecc Merge pull request #25424 from vieux/enabled
replace active by enabled for consistency in plugins
Upstream-commit: ed0dff8f16716b4f6debfc191124e98750dd05bb
Component: engine
2016-08-26 15:22:41 -07:00