Browse code

Update filter volume to allow filtering by bind mount source

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

Kenfe-Mickael Laventure authored on 2016/03/17 06:10:16
Showing 1 changed files
... ...
@@ -328,7 +328,11 @@ func includeContainerInList(container *container.Container, ctx *listContext) it
328 328
 	if ctx.filters.Include("volume") {
329 329
 		volumesByName := make(map[string]*volume.MountPoint)
330 330
 		for _, m := range container.MountPoints {
331
-			volumesByName[m.Name] = m
331
+			if m.Name != "" {
332
+				volumesByName[m.Name] = m
333
+			} else {
334
+				volumesByName[m.Source] = m
335
+			}
332 336
 		}
333 337
 
334 338
 		volumeExist := fmt.Errorf("volume mounted in container")