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>
(cherry picked from commit 8cb2229cd1)
This commit is contained in:
Anusha Ragunathan
2016-12-20 08:26:58 -08:00
committed by Tonis Tiigi
parent 05426c80d9
commit 2039ea6adc
13 changed files with 69 additions and 31 deletions

View File

@@ -21,11 +21,13 @@ Usage: docker plugin disable PLUGIN
Disable a plugin
Options:
--help Print usage
-f, --force Force the disable of an active plugin
--help Print usage
```
Disables a plugin. The plugin must be installed before it can be disabled,
see [`docker plugin install`](plugin_install.md).
see [`docker plugin install`](plugin_install.md). Without the `-f` option,
a plugin that has references (eg, volumes, networks) cannot be disabled.
The following example shows that the `no-remove` plugin is installed