Merge pull request #2331 from weaveworks/issues/2320-plugin-warning

Augment warning on active plugin endpoints
This commit is contained in:
Adam Harrison committed 2016-06-03 16:17:31 +01:00
commit 9b6154cf63
2 files changed
+14 -6

No files matched your search

+12
View File
@@ -47,6 +47,18 @@ func removePluginNetwork(args []string) error {
}
err = d.RemoveNetwork(networkName)
if _, ok := err.(*docker.NoSuchNetwork); !ok && err != nil {
if info, err2 := d.NetworkInfo(networkName); err2 == nil {
if len(info.Containers) > 0 {
containers := ""
for container := range info.Containers {
containers += fmt.Sprintf(" %.12s ", container)
}
return fmt.Errorf(`WARNING: the following containers are still attached to network %q:
%s
Docker operations involving those containers may pause or fail
while Weave is not running`, networkName, containers)
}
}
return fmt.Errorf("unable to remove network: %s", err)
}
return nil