Merge pull request #21400 from LK4D4/fix_volumes_race
volume/local: fix race in List Upstream-commit: 2ec1764d45de9269522cb084ec87c87dd6f3c4e0 Component: engine
This commit is contained in:
@ -121,9 +121,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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user