Ver código fonte

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>
Euan Harris 7 anos atrás
pai
commit
9b114971e5
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      libnetwork/controller.go

+ 2 - 1
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