Skip to content

Commit 7e575b8

Browse files
author
Arko Dasgupta
committed
Fix Error Check in NewNetwork
Use types.MaskableError instead of doing a string comparison Signed-off-by: Arko Dasgupta <[email protected]>
1 parent 96bcc0d commit 7e575b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
825825

826826
err = c.addNetwork(network)
827827
if err != nil {
828-
if strings.Contains(err.Error(), "restoring existing network") {
828+
if _, ok := err.(types.MaskableError); ok {
829829
// This error can be ignored and set this boolean
830830
// value to skip a refcount increment for configOnly networks
831831
skipCfgEpCount = true

0 commit comments

Comments
 (0)