diff --git a/integration-cli/docker_cli_daemon_experimental_test.go b/integration-cli/docker_cli_daemon_experimental_test.go index 5fe96ba3ba..cbfbfa32e8 100644 --- a/integration-cli/docker_cli_daemon_experimental_test.go +++ b/integration-cli/docker_cli_daemon_experimental_test.go @@ -206,6 +206,13 @@ func (s *DockerDaemonSuite) TestVolumePlugin(c *check.C) { } }() + out, err = s.d.Cmd("volume", "ls") + if err != nil { + c.Fatalf("Could not list volume: %v %s", err, out) + } + c.Assert(out, checker.Contains, volName) + c.Assert(out, checker.Contains, pluginName) + mountPoint, err := s.d.Cmd("volume", "inspect", volName, "--format", "{{.Mountpoint}}") if err != nil { c.Fatalf("Could not inspect volume: %v %s", err, mountPoint) diff --git a/plugin/manager.go b/plugin/manager.go index f292c09a5e..3bfab64c23 100644 --- a/plugin/manager.go +++ b/plugin/manager.go @@ -181,14 +181,13 @@ func FindWithCapability(capability string) ([]Plugin, error) { handleLegacy = manager.handleLegacy manager.RLock() defer manager.RUnlock() - pluginLoop: for _, p := range manager.plugins { for _, typ := range p.PluginObj.Manifest.Interface.Types { - if typ.Capability != capability || typ.Prefix != "docker" { - continue pluginLoop + if strings.EqualFold(typ.Capability, capability) && typ.Prefix == "docker" { + result = append(result, p) + break } } - result = append(result, p) } } if handleLegacy { @@ -244,9 +243,8 @@ func LookupWithCapability(name, capability string) (Plugin, error) { return nil, err } - capability = strings.ToLower(capability) for _, typ := range p.PluginObj.Manifest.Interface.Types { - if typ.Capability == capability && typ.Prefix == "docker" { + if strings.EqualFold(typ.Capability, capability) && typ.Prefix == "docker" { return p, nil } } diff --git a/volume/drivers/extpoint.go b/volume/drivers/extpoint.go index 3de897e16d..98fb06a24c 100644 --- a/volume/drivers/extpoint.go +++ b/volume/drivers/extpoint.go @@ -107,7 +107,7 @@ func lookup(name string) (volume.Driver, error) { return nil, fmt.Errorf("Error looking up volume plugin %s: %v", name, err) } - d := NewVolumeDriver(name, p.Client()) + d := NewVolumeDriver(p.Name(), p.Client()) if err := validateDriver(d); err != nil { return nil, err }