From 9b114971e53b2ee3a917dc20346e869bf4e432e7 Mon Sep 17 00:00:00 2001 From: Euan Harris Date: Tue, 12 Jun 2018 17:26:11 +0100 Subject: [PATCH] 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 --- libnetwork/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnetwork/controller.go b/libnetwork/controller.go index fe9c4ddf97..5e967b7c32 100644 --- a/libnetwork/controller.go +++ b/libnetwork/controller.go @@ -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