plugins: fix name handling for legacy plugins

Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2016-06-17 12:02:05 -07:00
parent cb321e82db
commit 8ba17b4823

View file

@ -204,7 +204,8 @@ func LookupWithCapability(name, capability string) (Plugin, error) {
)
handleLegacy := true
if manager != nil {
if named, err := reference.ParseNamed(name); err == nil { // FIXME: validate
fullName := name
if named, err := reference.ParseNamed(fullName); err == nil { // FIXME: validate
if reference.IsNameOnly(named) {
named = reference.WithDefaultTag(named)
}
@ -212,9 +213,9 @@ func LookupWithCapability(name, capability string) (Plugin, error) {
if !ok {
return nil, fmt.Errorf("invalid name: %s", named.String())
}
name = ref.String()
fullName = ref.String()
}
p, err = manager.get(name)
p, err = manager.get(fullName)
if err != nil {
if _, ok := err.(ErrNotFound); !ok {
return nil, err