Remove extra map lookup for volume drivers.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
This commit is contained in:
parent
6875f71d7c
commit
5d4627331e
1 changed files with 2 additions and 6 deletions
|
@ -107,19 +107,15 @@ func lookup(name string) (volume.Driver, error) {
|
|||
return nil, fmt.Errorf("Error looking up volume plugin %s: %v", name, err)
|
||||
}
|
||||
|
||||
drivers.Lock()
|
||||
defer drivers.Unlock()
|
||||
if ext, ok := drivers.extensions[name]; ok {
|
||||
return ext, nil
|
||||
}
|
||||
|
||||
d := NewVolumeDriver(name, p.Client())
|
||||
if err := validateDriver(d); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if p.IsLegacy() {
|
||||
drivers.Lock()
|
||||
drivers.extensions[name] = d
|
||||
drivers.Unlock()
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue