Browse code

delete plugin rootfs on plugin rm

Signed-off-by: Victor Vieux <vieux@docker.com>

Victor Vieux authored on 2016/11/05 09:37:41
Showing 2 changed files
... ...
@@ -27,6 +27,7 @@ func (s *DockerSuite) TestPluginBasicOps(c *check.C) {
27 27
 	c.Assert(out, checker.Contains, "true")
28 28
 
29 29
 	id, _, err := dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", pNameWithTag)
30
+	id = strings.TrimSpace(id)
30 31
 	c.Assert(err, checker.IsNil)
31 32
 
32 33
 	out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
... ...
@@ -162,6 +162,7 @@ func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error {
162 162
 	}
163 163
 
164 164
 	pm.pluginStore.Remove(p)
165
+	os.RemoveAll(filepath.Join(pm.libRoot, p.GetID()))
165 166
 	pm.pluginEventLogger(p.GetID(), name, "remove")
166 167
 	return nil
167 168
 }