浏览代码

Merge pull request #2411 from lemrouch/2410-fix

Macvlan network handles netlabel.Internal wrong
elangovan sivanandam 6 年之前
父节点
当前提交
43b7bc99dc
共有 2 个文件被更改,包括 12 次插入8 次删除
  1. 6 4
      libnetwork/drivers/ipvlan/ipvlan_network.go
  2. 6 4
      libnetwork/drivers/macvlan/macvlan_network.go

+ 6 - 4
libnetwork/drivers/ipvlan/ipvlan_network.go

@@ -182,10 +182,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err
 		}
 	}
 	// setting the parent to "" will trigger an isolated network dummy parent link
-	if _, ok := option[netlabel.Internal]; ok {
-		config.Internal = true
-		// empty --parent= and --internal are handled the same.
-		config.Parent = ""
+	if val, ok := option[netlabel.Internal]; ok {
+		if internal, ok := val.(bool); ok && internal {
+			config.Internal = true
+			// empty --parent= and --internal are handled the same.
+			config.Parent = ""
+		}
 	}
 	return config, nil
 }

+ 6 - 4
libnetwork/drivers/macvlan/macvlan_network.go

@@ -186,10 +186,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err
 		}
 	}
 	// setting the parent to "" will trigger an isolated network dummy parent link
-	if _, ok := option[netlabel.Internal]; ok {
-		config.Internal = true
-		// empty --parent= and --internal are handled the same.
-		config.Parent = ""
+	if val, ok := option[netlabel.Internal]; ok {
+		if internal, ok := val.(bool); ok && internal {
+			config.Internal = true
+			// empty --parent= and --internal are handled the same.
+			config.Parent = ""
+		}
 	}
 
 	return config, nil