controller: Unwrap error type returned by PluginGetter

moby/moby commit b27f70d45 wraps the ErrNotFound error returned when
a plugin cannot be found, to include a backtrace.   This changes the
type of the error, so contoller.loadDriver no longer converts it to a
libnetwork plugin.NotFoundError.  This causes a couple of tests which
inspect the return type to fail;  most code only checks whether the
error is non-nil and is not affected by the change in type.

Signed-off-by: Euan Harris <euan.harris@docker.com>
This commit is contained in:
Euan Harris 2018-06-12 17:26:11 +01:00
parent 6716626d32
commit 9b114971e5
1 changed files with 2 additions and 1 deletions

View File

@ -69,6 +69,7 @@ import (
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/osl"
"github.com/docker/libnetwork/types"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@ -1252,7 +1253,7 @@ func (c *controller) loadDriver(networkType string) error {
}
if err != nil {
if err == plugins.ErrNotFound {
if errors.Cause(err) == plugins.ErrNotFound {
return types.NotFoundErrorf(err.Error())
}
return err