mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
volume/local: fix race in List
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
de9ff4bdc0
commit
3536c09cea
1 changed files with 2 additions and 0 deletions
|
@ -117,9 +117,11 @@ type Root struct {
|
|||
// List lists all the volumes
|
||||
func (r *Root) List() ([]volume.Volume, error) {
|
||||
var ls []volume.Volume
|
||||
r.m.Lock()
|
||||
for _, v := range r.volumes {
|
||||
ls = append(ls, v)
|
||||
}
|
||||
r.m.Unlock()
|
||||
return ls, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue