Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
| ... | ... |
@@ -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")
|