1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix Error Check in NewNetwork

Use types.MaskableError instead of doing a string comparison

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
This commit is contained in:
Arko Dasgupta 2019-10-03 00:54:45 -07:00
parent 141b53c77a
commit 87b082f365

View file

@ -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