Replaced it with DisableBridgeCreation and it can be used ONLY in
a special case for docker0 bridge from docker, instead of calling it
from all other case.
Signed-off-by: Madhu Venugopal <madhu@docker.com>
| ... | ... |
@@ -291,9 +291,6 @@ func processCreateDefaults(c libnetwork.NetworkController, nc *networkCreate) {
|
| 291 | 291 |
if _, ok := gData["BridgeName"]; !ok {
|
| 292 | 292 |
gData["BridgeName"] = nc.Name |
| 293 | 293 |
} |
| 294 |
- if _, ok := gData["AllowNonDefaultBridge"]; !ok {
|
|
| 295 |
- gData["AllowNonDefaultBridge"] = "true" |
|
| 296 |
- } |
|
| 297 | 294 |
nc.Options[netlabel.GenericData] = genericData |
| 298 | 295 |
} |
| 299 | 296 |
} |
| ... | ... |
@@ -95,8 +95,7 @@ func createTestNetwork(t *testing.T, network string) (libnetwork.NetworkControll |
| 95 | 95 |
|
| 96 | 96 |
netOption := options.Generic{
|
| 97 | 97 |
netlabel.GenericData: options.Generic{
|
| 98 |
- "BridgeName": network, |
|
| 99 |
- "AllowNonDefaultBridge": true, |
|
| 98 |
+ "BridgeName": network, |
|
| 100 | 99 |
}, |
| 101 | 100 |
} |
| 102 | 101 |
netGeneric := libnetwork.NetworkOptionGeneric(netOption) |
| ... | ... |
@@ -210,10 +209,9 @@ func TestCreateDeleteNetwork(t *testing.T) {
|
| 210 | 210 |
ops := options.Generic{
|
| 211 | 211 |
netlabel.EnableIPv6: true, |
| 212 | 212 |
netlabel.GenericData: map[string]string{
|
| 213 |
- "BridgeName": "abc", |
|
| 214 |
- "AllowNonDefaultBridge": "true", |
|
| 215 |
- "FixedCIDRv6": "fe80::1/64", |
|
| 216 |
- "AddressIP": "172.28.30.254/24", |
|
| 213 |
+ "BridgeName": "abc", |
|
| 214 |
+ "FixedCIDRv6": "fe80::1/64", |
|
| 215 |
+ "AddressIP": "172.28.30.254/24", |
|
| 217 | 216 |
}, |
| 218 | 217 |
} |
| 219 | 218 |
nc := networkCreate{Name: "network_1", NetworkType: bridgeNetType, Options: ops}
|
| ... | ... |
@@ -256,8 +254,7 @@ func TestGetNetworksAndEndpoints(t *testing.T) {
|
| 256 | 256 |
|
| 257 | 257 |
ops := options.Generic{
|
| 258 | 258 |
netlabel.GenericData: map[string]string{
|
| 259 |
- "BridgeName": "api_test_nw", |
|
| 260 |
- "AllowNonDefaultBridge": "true", |
|
| 259 |
+ "BridgeName": "api_test_nw", |
|
| 261 | 260 |
}, |
| 262 | 261 |
} |
| 263 | 262 |
|
| ... | ... |
@@ -527,8 +524,7 @@ func TestProcGetServices(t *testing.T) {
|
| 527 | 527 |
netName1 := "production" |
| 528 | 528 |
netOption := options.Generic{
|
| 529 | 529 |
netlabel.GenericData: options.Generic{
|
| 530 |
- "BridgeName": netName1, |
|
| 531 |
- "AllowNonDefaultBridge": true, |
|
| 530 |
+ "BridgeName": netName1, |
|
| 532 | 531 |
}, |
| 533 | 532 |
} |
| 534 | 533 |
nw1, err := c.NewNetwork(bridgeNetType, netName1, libnetwork.NetworkOptionGeneric(netOption)) |
| ... | ... |
@@ -539,8 +535,7 @@ func TestProcGetServices(t *testing.T) {
|
| 539 | 539 |
netName2 := "work-dev" |
| 540 | 540 |
netOption = options.Generic{
|
| 541 | 541 |
netlabel.GenericData: options.Generic{
|
| 542 |
- "BridgeName": netName2, |
|
| 543 |
- "AllowNonDefaultBridge": true, |
|
| 542 |
+ "BridgeName": netName2, |
|
| 544 | 543 |
}, |
| 545 | 544 |
} |
| 546 | 545 |
nw2, err := c.NewNetwork(bridgeNetType, netName2, libnetwork.NetworkOptionGeneric(netOption)) |
| ... | ... |
@@ -1771,14 +1766,13 @@ func TestEndToEnd(t *testing.T) {
|
| 1771 | 1771 |
ops := options.Generic{
|
| 1772 | 1772 |
netlabel.EnableIPv6: true, |
| 1773 | 1773 |
netlabel.GenericData: map[string]string{
|
| 1774 |
- "BridgeName": "cdef", |
|
| 1775 |
- "FixedCIDRv6": "fe80:2000::1/64", |
|
| 1776 |
- "EnableIPv6": "true", |
|
| 1777 |
- "Mtu": "1460", |
|
| 1778 |
- "EnableIPTables": "true", |
|
| 1779 |
- "AddressIP": "172.28.30.254/16", |
|
| 1780 |
- "EnableUserlandProxy": "true", |
|
| 1781 |
- "AllowNonDefaultBridge": "true", |
|
| 1774 |
+ "BridgeName": "cdef", |
|
| 1775 |
+ "FixedCIDRv6": "fe80:2000::1/64", |
|
| 1776 |
+ "EnableIPv6": "true", |
|
| 1777 |
+ "Mtu": "1460", |
|
| 1778 |
+ "EnableIPTables": "true", |
|
| 1779 |
+ "AddressIP": "172.28.30.254/16", |
|
| 1780 |
+ "EnableUserlandProxy": "true", |
|
| 1782 | 1781 |
}, |
| 1783 | 1782 |
} |
| 1784 | 1783 |
|
| ... | ... |
@@ -115,8 +115,7 @@ func createDefaultNetwork(c libnetwork.NetworkController) {
|
| 115 | 115 |
// Bridge driver is special due to legacy reasons |
| 116 | 116 |
if d == "bridge" {
|
| 117 | 117 |
genericOption[netlabel.GenericData] = map[string]interface{}{
|
| 118 |
- "BridgeName": nw, |
|
| 119 |
- "AllowNonDefaultBridge": "true", |
|
| 118 |
+ "BridgeName": nw, |
|
| 120 | 119 |
} |
| 121 | 120 |
networkOption := libnetwork.NetworkOptionGeneric(genericOption) |
| 122 | 121 |
createOptions = append(createOptions, networkOption) |
| ... | ... |
@@ -93,10 +93,9 @@ func (sb *sandbox) clearDefaultGW() error {
|
| 93 | 93 |
|
| 94 | 94 |
func (c *controller) createGWNetwork() (Network, error) {
|
| 95 | 95 |
netOption := options.Generic{
|
| 96 |
- "BridgeName": libnGWNetwork, |
|
| 97 |
- "EnableICC": false, |
|
| 98 |
- "AllowNonDefaultBridge": true, |
|
| 99 |
- "EnableIPMasquerade": true, |
|
| 96 |
+ "BridgeName": libnGWNetwork, |
|
| 97 |
+ "EnableICC": false, |
|
| 98 |
+ "EnableIPMasquerade": true, |
|
| 100 | 99 |
} |
| 101 | 100 |
|
| 102 | 101 |
n, err := c.NewNetwork("bridge", libnGWNetwork,
|
| ... | ... |
@@ -59,7 +59,7 @@ type networkConfiguration struct {
|
| 59 | 59 |
DefaultGatewayIPv4 net.IP |
| 60 | 60 |
DefaultGatewayIPv6 net.IP |
| 61 | 61 |
DefaultBindingIP net.IP |
| 62 |
- AllowNonDefaultBridge bool |
|
| 62 |
+ DisableBridgeCreation bool |
|
| 63 | 63 |
} |
| 64 | 64 |
|
| 65 | 65 |
// endpointConfiguration represents the user specified configuration for the sandbox endpoint |
| ... | ... |
@@ -249,13 +249,13 @@ func (c *networkConfiguration) fromMap(data map[string]interface{}) error {
|
| 249 | 249 |
} |
| 250 | 250 |
} |
| 251 | 251 |
|
| 252 |
- if i, ok := data["AllowNonDefaultBridge"]; ok && i != nil {
|
|
| 252 |
+ if i, ok := data["DisableBridgeCreation"]; ok && i != nil {
|
|
| 253 | 253 |
if s, ok := i.(string); ok {
|
| 254 |
- if c.AllowNonDefaultBridge, err = strconv.ParseBool(s); err != nil {
|
|
| 255 |
- return types.BadRequestErrorf("failed to parse AllowNonDefaultBridge value: %s", err.Error())
|
|
| 254 |
+ if c.DisableBridgeCreation, err = strconv.ParseBool(s); err != nil {
|
|
| 255 |
+ return types.BadRequestErrorf("failed to parse DisableBridgeCreation value: %s", err.Error())
|
|
| 256 | 256 |
} |
| 257 | 257 |
} else {
|
| 258 |
- return types.BadRequestErrorf("invalid type for AllowNonDefaultBridge value")
|
|
| 258 |
+ return types.BadRequestErrorf("invalid type for DisableBridgeCreation value")
|
|
| 259 | 259 |
} |
| 260 | 260 |
} |
| 261 | 261 |
|
| ... | ... |
@@ -123,7 +123,7 @@ func TestCreateFail(t *testing.T) {
|
| 123 | 123 |
t.Fatalf("Failed to setup driver config: %v", err)
|
| 124 | 124 |
} |
| 125 | 125 |
|
| 126 |
- netconfig := &networkConfiguration{BridgeName: "dummy0"}
|
|
| 126 |
+ netconfig := &networkConfiguration{BridgeName: "dummy0", DisableBridgeCreation: true}
|
|
| 127 | 127 |
genericOption := make(map[string]interface{})
|
| 128 | 128 |
genericOption[netlabel.GenericData] = netconfig |
| 129 | 129 |
|
| ... | ... |
@@ -146,20 +146,20 @@ func TestCreateMultipleNetworks(t *testing.T) {
|
| 146 | 146 |
t.Fatalf("Failed to setup driver config: %v", err)
|
| 147 | 147 |
} |
| 148 | 148 |
|
| 149 |
- config1 := &networkConfiguration{BridgeName: "net_test_1", AllowNonDefaultBridge: true}
|
|
| 149 |
+ config1 := &networkConfiguration{BridgeName: "net_test_1"}
|
|
| 150 | 150 |
genericOption = make(map[string]interface{})
|
| 151 | 151 |
genericOption[netlabel.GenericData] = config1 |
| 152 | 152 |
if err := d.CreateNetwork("1", genericOption); err != nil {
|
| 153 | 153 |
t.Fatalf("Failed to create bridge: %v", err)
|
| 154 | 154 |
} |
| 155 | 155 |
|
| 156 |
- config2 := &networkConfiguration{BridgeName: "net_test_2", AllowNonDefaultBridge: true}
|
|
| 156 |
+ config2 := &networkConfiguration{BridgeName: "net_test_2"}
|
|
| 157 | 157 |
genericOption[netlabel.GenericData] = config2 |
| 158 | 158 |
if err := d.CreateNetwork("2", genericOption); err != nil {
|
| 159 | 159 |
t.Fatalf("Failed to create bridge: %v", err)
|
| 160 | 160 |
} |
| 161 | 161 |
|
| 162 |
- config3 := &networkConfiguration{BridgeName: "net_test_3", AllowNonDefaultBridge: true}
|
|
| 162 |
+ config3 := &networkConfiguration{BridgeName: "net_test_3"}
|
|
| 163 | 163 |
genericOption[netlabel.GenericData] = config3 |
| 164 | 164 |
if err := d.CreateNetwork("3", genericOption); err != nil {
|
| 165 | 165 |
t.Fatalf("Failed to create bridge: %v", err)
|
| ... | ... |
@@ -168,7 +168,7 @@ func TestCreateMultipleNetworks(t *testing.T) {
|
| 168 | 168 |
// Verify the network isolation rules are installed, each network subnet should appear 4 times |
| 169 | 169 |
verifyV4INCEntries(d.networks, 4, t) |
| 170 | 170 |
|
| 171 |
- config4 := &networkConfiguration{BridgeName: "net_test_4", AllowNonDefaultBridge: true}
|
|
| 171 |
+ config4 := &networkConfiguration{BridgeName: "net_test_4"}
|
|
| 172 | 172 |
genericOption[netlabel.GenericData] = config4 |
| 173 | 173 |
if err := d.CreateNetwork("4", genericOption); err != nil {
|
| 174 | 174 |
t.Fatalf("Failed to create bridge: %v", err)
|
| ... | ... |
@@ -211,6 +211,17 @@ func (ndbee NonDefaultBridgeExistError) Error() string {
|
| 211 | 211 |
// Forbidden denotes the type of this error |
| 212 | 212 |
func (ndbee NonDefaultBridgeExistError) Forbidden() {}
|
| 213 | 213 |
|
| 214 |
+// NonDefaultBridgeNeedsIPError is returned when a non-default |
|
| 215 |
+// bridge config is passed but it has no ip configured |
|
| 216 |
+type NonDefaultBridgeNeedsIPError string |
|
| 217 |
+ |
|
| 218 |
+func (ndbee NonDefaultBridgeNeedsIPError) Error() string {
|
|
| 219 |
+ return fmt.Sprintf("bridge device with non default name %s must have a valid IP address", string(ndbee))
|
|
| 220 |
+} |
|
| 221 |
+ |
|
| 222 |
+// Forbidden denotes the type of this error |
|
| 223 |
+func (ndbee NonDefaultBridgeNeedsIPError) Forbidden() {}
|
|
| 224 |
+ |
|
| 214 | 225 |
// FixedCIDRv4Error is returned when fixed-cidrv4 configuration |
| 215 | 226 |
// failed. |
| 216 | 227 |
type FixedCIDRv4Error struct {
|
| ... | ... |
@@ -15,7 +15,7 @@ func setupDevice(config *networkConfiguration, i *bridgeInterface) error {
|
| 15 | 15 |
|
| 16 | 16 |
// We only attempt to create the bridge when the requested device name is |
| 17 | 17 |
// the default one. |
| 18 |
- if config.BridgeName != DefaultBridgeName && !config.AllowNonDefaultBridge {
|
|
| 18 |
+ if config.BridgeName != DefaultBridgeName && config.DisableBridgeCreation {
|
|
| 19 | 19 |
return NonDefaultBridgeExistError(config.BridgeName) |
| 20 | 20 |
} |
| 21 | 21 |
|
| ... | ... |
@@ -33,7 +33,7 @@ func TestSetupNewBridge(t *testing.T) {
|
| 33 | 33 |
func TestSetupNewNonDefaultBridge(t *testing.T) {
|
| 34 | 34 |
defer testutils.SetupTestOSContext(t)() |
| 35 | 35 |
|
| 36 |
- config := &networkConfiguration{BridgeName: "test0"}
|
|
| 36 |
+ config := &networkConfiguration{BridgeName: "test0", DisableBridgeCreation: true}
|
|
| 37 | 37 |
br := &bridgeInterface{}
|
| 38 | 38 |
|
| 39 | 39 |
err := setupDevice(config, br) |
| ... | ... |
@@ -53,8 +53,8 @@ func setupBridgeIPv4(config *networkConfiguration, i *bridgeInterface) error {
|
| 53 | 53 |
|
| 54 | 54 |
// Do not try to configure IPv4 on a non-default bridge unless you are |
| 55 | 55 |
// specifically asked to do so. |
| 56 |
- if config.BridgeName != DefaultBridgeName && !config.AllowNonDefaultBridge {
|
|
| 57 |
- return NonDefaultBridgeExistError(config.BridgeName) |
|
| 56 |
+ if config.BridgeName != DefaultBridgeName && config.DisableBridgeCreation {
|
|
| 57 |
+ return NonDefaultBridgeNeedsIPError(config.BridgeName) |
|
| 58 | 58 |
} |
| 59 | 59 |
|
| 60 | 60 |
bridgeIPv4, err := electBridgeIPv4(config) |
| ... | ... |
@@ -288,14 +288,13 @@ func TestBridge(t *testing.T) {
|
| 288 | 288 |
|
| 289 | 289 |
netOption := options.Generic{
|
| 290 | 290 |
netlabel.GenericData: options.Generic{
|
| 291 |
- "BridgeName": "testnetwork", |
|
| 292 |
- "AddressIPv4": subnet, |
|
| 293 |
- "FixedCIDR": cidr, |
|
| 294 |
- "FixedCIDRv6": cidrv6, |
|
| 295 |
- "EnableIPv6": true, |
|
| 296 |
- "EnableICC": true, |
|
| 297 |
- "AllowNonDefaultBridge": true, |
|
| 298 |
- "EnableIPMasquerade": true, |
|
| 291 |
+ "BridgeName": "testnetwork", |
|
| 292 |
+ "AddressIPv4": subnet, |
|
| 293 |
+ "FixedCIDR": cidr, |
|
| 294 |
+ "FixedCIDRv6": cidrv6, |
|
| 295 |
+ "EnableIPv6": true, |
|
| 296 |
+ "EnableICC": true, |
|
| 297 |
+ "EnableIPMasquerade": true, |
|
| 299 | 298 |
}, |
| 300 | 299 |
} |
| 301 | 300 |
|
| ... | ... |
@@ -389,8 +388,7 @@ func TestNetworkName(t *testing.T) {
|
| 389 | 389 |
|
| 390 | 390 |
netOption := options.Generic{
|
| 391 | 391 |
netlabel.GenericData: options.Generic{
|
| 392 |
- "BridgeName": "testnetwork", |
|
| 393 |
- "AllowNonDefaultBridge": true, |
|
| 392 |
+ "BridgeName": "testnetwork", |
|
| 394 | 393 |
}, |
| 395 | 394 |
} |
| 396 | 395 |
|
| ... | ... |
@@ -426,8 +424,7 @@ func TestNetworkType(t *testing.T) {
|
| 426 | 426 |
|
| 427 | 427 |
netOption := options.Generic{
|
| 428 | 428 |
netlabel.GenericData: options.Generic{
|
| 429 |
- "BridgeName": "testnetwork", |
|
| 430 |
- "AllowNonDefaultBridge": true, |
|
| 429 |
+ "BridgeName": "testnetwork", |
|
| 431 | 430 |
}, |
| 432 | 431 |
} |
| 433 | 432 |
|
| ... | ... |
@@ -453,8 +450,7 @@ func TestNetworkID(t *testing.T) {
|
| 453 | 453 |
|
| 454 | 454 |
netOption := options.Generic{
|
| 455 | 455 |
netlabel.GenericData: options.Generic{
|
| 456 |
- "BridgeName": "testnetwork", |
|
| 457 |
- "AllowNonDefaultBridge": true, |
|
| 456 |
+ "BridgeName": "testnetwork", |
|
| 458 | 457 |
}, |
| 459 | 458 |
} |
| 460 | 459 |
|
| ... | ... |
@@ -479,8 +475,8 @@ func TestDeleteNetworkWithActiveEndpoints(t *testing.T) {
|
| 479 | 479 |
} |
| 480 | 480 |
|
| 481 | 481 |
netOption := options.Generic{
|
| 482 |
- "BridgeName": "testnetwork", |
|
| 483 |
- "AllowNonDefaultBridge": true} |
|
| 482 |
+ "BridgeName": "testnetwork", |
|
| 483 |
+ } |
|
| 484 | 484 |
option := options.Generic{
|
| 485 | 485 |
netlabel.GenericData: netOption, |
| 486 | 486 |
} |
| ... | ... |
@@ -520,8 +516,8 @@ func TestUnknownNetwork(t *testing.T) {
|
| 520 | 520 |
} |
| 521 | 521 |
|
| 522 | 522 |
netOption := options.Generic{
|
| 523 |
- "BridgeName": "testnetwork", |
|
| 524 |
- "AllowNonDefaultBridge": true} |
|
| 523 |
+ "BridgeName": "testnetwork", |
|
| 524 |
+ } |
|
| 525 | 525 |
option := options.Generic{
|
| 526 | 526 |
netlabel.GenericData: netOption, |
| 527 | 527 |
} |
| ... | ... |
@@ -558,9 +554,9 @@ func TestUnknownEndpoint(t *testing.T) {
|
| 558 | 558 |
subnet.IP = ip |
| 559 | 559 |
|
| 560 | 560 |
netOption := options.Generic{
|
| 561 |
- "BridgeName": "testnetwork", |
|
| 562 |
- "AddressIPv4": subnet, |
|
| 563 |
- "AllowNonDefaultBridge": true} |
|
| 561 |
+ "BridgeName": "testnetwork", |
|
| 562 |
+ "AddressIPv4": subnet, |
|
| 563 |
+ } |
|
| 564 | 564 |
option := options.Generic{
|
| 565 | 565 |
netlabel.GenericData: netOption, |
| 566 | 566 |
} |
| ... | ... |
@@ -602,8 +598,7 @@ func TestNetworkEndpointsWalkers(t *testing.T) {
|
| 602 | 602 |
// Create network 1 and add 2 endpoint: ep11, ep12 |
| 603 | 603 |
netOption := options.Generic{
|
| 604 | 604 |
netlabel.GenericData: options.Generic{
|
| 605 |
- "BridgeName": "network1", |
|
| 606 |
- "AllowNonDefaultBridge": true, |
|
| 605 |
+ "BridgeName": "network1", |
|
| 607 | 606 |
}, |
| 608 | 607 |
} |
| 609 | 608 |
|
| ... | ... |
@@ -675,8 +670,7 @@ func TestNetworkEndpointsWalkers(t *testing.T) {
|
| 675 | 675 |
// Create network 2 |
| 676 | 676 |
netOption = options.Generic{
|
| 677 | 677 |
netlabel.GenericData: options.Generic{
|
| 678 |
- "BridgeName": "network2", |
|
| 679 |
- "AllowNonDefaultBridge": true, |
|
| 678 |
+ "BridgeName": "network2", |
|
| 680 | 679 |
}, |
| 681 | 680 |
} |
| 682 | 681 |
|
| ... | ... |
@@ -733,8 +727,7 @@ func TestDuplicateEndpoint(t *testing.T) {
|
| 733 | 733 |
|
| 734 | 734 |
netOption := options.Generic{
|
| 735 | 735 |
netlabel.GenericData: options.Generic{
|
| 736 |
- "BridgeName": "testnetwork", |
|
| 737 |
- "AllowNonDefaultBridge": true, |
|
| 736 |
+ "BridgeName": "testnetwork", |
|
| 738 | 737 |
}, |
| 739 | 738 |
} |
| 740 | 739 |
n, err := createTestNetwork(bridgeNetType, "testnetwork", netOption) |
| ... | ... |
@@ -784,8 +777,7 @@ func TestControllerQuery(t *testing.T) {
|
| 784 | 784 |
// Create network 1 |
| 785 | 785 |
netOption := options.Generic{
|
| 786 | 786 |
netlabel.GenericData: options.Generic{
|
| 787 |
- "BridgeName": "network1", |
|
| 788 |
- "AllowNonDefaultBridge": true, |
|
| 787 |
+ "BridgeName": "network1", |
|
| 789 | 788 |
}, |
| 790 | 789 |
} |
| 791 | 790 |
net1, err := createTestNetwork(bridgeNetType, "network1", netOption) |
| ... | ... |
@@ -801,8 +793,7 @@ func TestControllerQuery(t *testing.T) {
|
| 801 | 801 |
// Create network 2 |
| 802 | 802 |
netOption = options.Generic{
|
| 803 | 803 |
netlabel.GenericData: options.Generic{
|
| 804 |
- "BridgeName": "network2", |
|
| 805 |
- "AllowNonDefaultBridge": true, |
|
| 804 |
+ "BridgeName": "network2", |
|
| 806 | 805 |
}, |
| 807 | 806 |
} |
| 808 | 807 |
net2, err := createTestNetwork(bridgeNetType, "network2", netOption) |
| ... | ... |
@@ -888,8 +879,7 @@ func TestNetworkQuery(t *testing.T) {
|
| 888 | 888 |
// Create network 1 and add 2 endpoint: ep11, ep12 |
| 889 | 889 |
netOption := options.Generic{
|
| 890 | 890 |
netlabel.GenericData: options.Generic{
|
| 891 |
- "BridgeName": "network1", |
|
| 892 |
- "AllowNonDefaultBridge": true, |
|
| 891 |
+ "BridgeName": "network1", |
|
| 893 | 892 |
}, |
| 894 | 893 |
} |
| 895 | 894 |
net1, err := createTestNetwork(bridgeNetType, "network1", netOption) |
| ... | ... |
@@ -1010,8 +1000,7 @@ func TestEndpointJoin(t *testing.T) {
|
| 1010 | 1010 |
// Create network 1 and add 2 endpoint: ep11, ep12 |
| 1011 | 1011 |
n1, err := createTestNetwork(bridgeNetType, "testnetwork1", options.Generic{
|
| 1012 | 1012 |
netlabel.GenericData: options.Generic{
|
| 1013 |
- "BridgeName": "testnetwork1", |
|
| 1014 |
- "AllowNonDefaultBridge": true, |
|
| 1013 |
+ "BridgeName": "testnetwork1", |
|
| 1015 | 1014 |
}, |
| 1016 | 1015 |
}) |
| 1017 | 1016 |
if err != nil {
|
| ... | ... |
@@ -1121,8 +1110,7 @@ func TestEndpointJoin(t *testing.T) {
|
| 1121 | 1121 |
n2, err := createTestNetwork(bridgeNetType, "testnetwork2", |
| 1122 | 1122 |
options.Generic{
|
| 1123 | 1123 |
netlabel.GenericData: options.Generic{
|
| 1124 |
- "BridgeName": "testnetwork2", |
|
| 1125 |
- "AllowNonDefaultBridge": true, |
|
| 1124 |
+ "BridgeName": "testnetwork2", |
|
| 1126 | 1125 |
}, |
| 1127 | 1126 |
}) |
| 1128 | 1127 |
if err != nil {
|
| ... | ... |
@@ -1213,8 +1201,7 @@ func externalKeyTest(t *testing.T, reexec bool) {
|
| 1213 | 1213 |
|
| 1214 | 1214 |
n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
|
| 1215 | 1215 |
netlabel.GenericData: options.Generic{
|
| 1216 |
- "BridgeName": "testnetwork", |
|
| 1217 |
- "AllowNonDefaultBridge": true, |
|
| 1216 |
+ "BridgeName": "testnetwork", |
|
| 1218 | 1217 |
}, |
| 1219 | 1218 |
}) |
| 1220 | 1219 |
if err != nil {
|
| ... | ... |
@@ -1363,8 +1350,7 @@ func TestEndpointDeleteWithActiveContainer(t *testing.T) {
|
| 1363 | 1363 |
|
| 1364 | 1364 |
n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
|
| 1365 | 1365 |
netlabel.GenericData: options.Generic{
|
| 1366 |
- "BridgeName": "testnetwork", |
|
| 1367 |
- "AllowNonDefaultBridge": true, |
|
| 1366 |
+ "BridgeName": "testnetwork", |
|
| 1368 | 1367 |
}, |
| 1369 | 1368 |
}) |
| 1370 | 1369 |
if err != nil {
|
| ... | ... |
@@ -1427,8 +1413,7 @@ func TestEndpointMultipleJoins(t *testing.T) {
|
| 1427 | 1427 |
|
| 1428 | 1428 |
n, err := createTestNetwork(bridgeNetType, "testmultiple", options.Generic{
|
| 1429 | 1429 |
netlabel.GenericData: options.Generic{
|
| 1430 |
- "BridgeName": "testmultiple", |
|
| 1431 |
- "AllowNonDefaultBridge": true, |
|
| 1430 |
+ "BridgeName": "testmultiple", |
|
| 1432 | 1431 |
}, |
| 1433 | 1432 |
}) |
| 1434 | 1433 |
if err != nil {
|
| ... | ... |
@@ -1499,8 +1484,7 @@ func TestLeaveAll(t *testing.T) {
|
| 1499 | 1499 |
|
| 1500 | 1500 |
n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
|
| 1501 | 1501 |
netlabel.GenericData: options.Generic{
|
| 1502 |
- "BridgeName": "testnetwork", |
|
| 1503 |
- "AllowNonDefaultBridge": true, |
|
| 1502 |
+ "BridgeName": "testnetwork", |
|
| 1504 | 1503 |
}, |
| 1505 | 1504 |
}) |
| 1506 | 1505 |
if err != nil {
|
| ... | ... |
@@ -1563,8 +1547,7 @@ func TestontainerInvalidLeave(t *testing.T) {
|
| 1563 | 1563 |
|
| 1564 | 1564 |
n, err := createTestNetwork(bridgeNetType, "testnetwork", options.Generic{
|
| 1565 | 1565 |
netlabel.GenericData: options.Generic{
|
| 1566 |
- "BridgeName": "testnetwork", |
|
| 1567 |
- "AllowNonDefaultBridge": true, |
|
| 1566 |
+ "BridgeName": "testnetwork", |
|
| 1568 | 1567 |
}, |
| 1569 | 1568 |
}) |
| 1570 | 1569 |
if err != nil {
|
| ... | ... |
@@ -1630,8 +1613,7 @@ func TestEndpointUpdateParent(t *testing.T) {
|
| 1630 | 1630 |
|
| 1631 | 1631 |
n, err := createTestNetwork("bridge", "testnetwork", options.Generic{
|
| 1632 | 1632 |
netlabel.GenericData: options.Generic{
|
| 1633 |
- "BridgeName": "testnetwork", |
|
| 1634 |
- "AllowNonDefaultBridge": true, |
|
| 1633 |
+ "BridgeName": "testnetwork", |
|
| 1635 | 1634 |
}, |
| 1636 | 1635 |
}) |
| 1637 | 1636 |
if err != nil {
|
| ... | ... |
@@ -1736,9 +1718,8 @@ func TestEnableIPv6(t *testing.T) {
|
| 1736 | 1736 |
netOption := options.Generic{
|
| 1737 | 1737 |
netlabel.EnableIPv6: true, |
| 1738 | 1738 |
netlabel.GenericData: options.Generic{
|
| 1739 |
- "BridgeName": "testnetwork", |
|
| 1740 |
- "FixedCIDRv6": cidrv6, |
|
| 1741 |
- "AllowNonDefaultBridge": true, |
|
| 1739 |
+ "BridgeName": "testnetwork", |
|
| 1740 |
+ "FixedCIDRv6": cidrv6, |
|
| 1742 | 1741 |
}, |
| 1743 | 1742 |
} |
| 1744 | 1743 |
|
| ... | ... |
@@ -1909,8 +1890,7 @@ func TestResolvConf(t *testing.T) {
|
| 1909 | 1909 |
|
| 1910 | 1910 |
netOption := options.Generic{
|
| 1911 | 1911 |
netlabel.GenericData: options.Generic{
|
| 1912 |
- "BridgeName": "testnetwork", |
|
| 1913 |
- "AllowNonDefaultBridge": true, |
|
| 1912 |
+ "BridgeName": "testnetwork", |
|
| 1914 | 1913 |
}, |
| 1915 | 1914 |
} |
| 1916 | 1915 |
n, err := createTestNetwork("bridge", "testnetwork", netOption)
|
| ... | ... |
@@ -2178,8 +2158,7 @@ func createGlobalInstance(t *testing.T) {
|
| 2178 | 2178 |
|
| 2179 | 2179 |
netOption := options.Generic{
|
| 2180 | 2180 |
netlabel.GenericData: options.Generic{
|
| 2181 |
- "BridgeName": "network", |
|
| 2182 |
- "AllowNonDefaultBridge": true, |
|
| 2181 |
+ "BridgeName": "network", |
|
| 2183 | 2182 |
}, |
| 2184 | 2183 |
} |
| 2185 | 2184 |
|
| ... | ... |
@@ -35,8 +35,7 @@ func getTestEnv(t *testing.T) (NetworkController, Network, Network) {
|
| 35 | 35 |
name1 := "test_nw_1" |
| 36 | 36 |
netOption1 := options.Generic{
|
| 37 | 37 |
netlabel.GenericData: options.Generic{
|
| 38 |
- "BridgeName": name1, |
|
| 39 |
- "AllowNonDefaultBridge": true, |
|
| 38 |
+ "BridgeName": name1, |
|
| 40 | 39 |
}, |
| 41 | 40 |
} |
| 42 | 41 |
n1, err := c.NewNetwork(netType, name1, NetworkOptionGeneric(netOption1)) |
| ... | ... |
@@ -47,8 +46,7 @@ func getTestEnv(t *testing.T) (NetworkController, Network, Network) {
|
| 47 | 47 |
name2 := "test_nw_2" |
| 48 | 48 |
netOption2 := options.Generic{
|
| 49 | 49 |
netlabel.GenericData: options.Generic{
|
| 50 |
- "BridgeName": name2, |
|
| 51 |
- "AllowNonDefaultBridge": true, |
|
| 50 |
+ "BridgeName": name2, |
|
| 52 | 51 |
}, |
| 53 | 52 |
} |
| 54 | 53 |
n2, err := c.NewNetwork(netType, name2, NetworkOptionGeneric(netOption2)) |