Explorar o código

Merge pull request #2459 from arkodg/fix-error-check

Fix Error Check in NewNetwork
elangovan sivanandam %!s(int64=5) %!d(string=hai) anos
pai
achega
4540e13414
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      libnetwork/controller.go

+ 1 - 1
libnetwork/controller.go

@@ -825,7 +825,7 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
 
 	err = c.addNetwork(network)
 	if err != nil {
-		if strings.Contains(err.Error(), "restoring existing network") {
+		if _, ok := err.(types.MaskableError); ok {
 			// This error can be ignored and set this boolean
 			// value to skip a refcount increment for configOnly networks
 			skipCfgEpCount = true