mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update filter volume to allow filtering by bind mount source
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
cb8cc56c22
commit
8451a08ed5
1 changed files with 5 additions and 1 deletions
|
@ -328,7 +328,11 @@ func includeContainerInList(container *container.Container, ctx *listContext) it
|
||||||
if ctx.filters.Include("volume") {
|
if ctx.filters.Include("volume") {
|
||||||
volumesByName := make(map[string]*volume.MountPoint)
|
volumesByName := make(map[string]*volume.MountPoint)
|
||||||
for _, m := range container.MountPoints {
|
for _, m := range container.MountPoints {
|
||||||
volumesByName[m.Name] = m
|
if m.Name != "" {
|
||||||
|
volumesByName[m.Name] = m
|
||||||
|
} else {
|
||||||
|
volumesByName[m.Source] = m
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
volumeExist := fmt.Errorf("volume mounted in container")
|
volumeExist := fmt.Errorf("volume mounted in container")
|
||||||
|
|
Loading…
Add table
Reference in a new issue