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

Merge pull request #82 from dave-tucker/simplebridge

Rename simplebridge to bridge
This commit is contained in:
Jana Radhakrishnan 2015-04-23 11:22:44 -07:00
commit 565a7daa7a
7 changed files with 24 additions and 24 deletions

View file

@ -26,7 +26,7 @@ There are many networking solutions available to suit a broad range of use-cases
// This option is only needed for in-tree drivers. Plugins(in future) will get
// their options through plugin infrastructure.
option := options.Generic{}
driver, err := controller.NewNetworkDriver("simplebridge", option)
driver, err := controller.NewNetworkDriver("bridge", option)
if err != nil {
return
}

View file

@ -11,7 +11,7 @@ func main() {
controller := libnetwork.New()
option := options.Generic{}
driver, err := controller.NewNetworkDriver("simplebridge", option)
driver, err := controller.NewNetworkDriver("bridge", option)
if err != nil {
return
}

View file

@ -15,7 +15,7 @@ func main() {
options := options.Generic{"AddressIPv4": net}
controller := libnetwork.New()
driver, _ := controller.NewNetworkDriver("simplebridge", options)
driver, _ := controller.NewNetworkDriver("bridge", options)
netw, err := controller.NewNetwork(driver, "dummy", "")
if err != nil {
log.Fatal(err)

View file

@ -16,7 +16,7 @@ import (
)
const (
networkType = "simplebridge"
networkType = "bridge"
vethPrefix = "veth"
vethLen = 7
containerVeth = "eth0"
@ -27,7 +27,7 @@ var (
portMapper *portmapper.PortMapper
)
// Configuration info for the "simplebridge" driver.
// Configuration info for the "bridge" driver.
type Configuration struct {
BridgeName string
AddressIPv4 *net.IPNet
@ -111,7 +111,7 @@ func (d *driver) Config(option interface{}) error {
return nil
}
// Create a new network using simplebridge plugin
// Create a new network using bridge plugin
func (d *driver) CreateNetwork(id types.UUID, option interface{}) error {
var err error

View file

@ -8,13 +8,13 @@ import (
var (
// ErrConfigExists error is returned when driver already has a config applied.
ErrConfigExists = errors.New("configuration already exists, simplebridge configuration can be applied only once")
ErrConfigExists = errors.New("configuration already exists, bridge configuration can be applied only once")
// ErrInvalidConfig error is returned when a network is created on a driver without valid config.
ErrInvalidConfig = errors.New("trying to create a network on a driver without valid config")
// ErrNetworkExists error is returned when a network already exists and another network is created.
ErrNetworkExists = errors.New("network already exists, simplebridge can only have one network")
ErrNetworkExists = errors.New("network already exists, bridge can only have one network")
// ErrIfaceName error is returned when a new name could not be generated.
ErrIfaceName = errors.New("failed to find name for new interface")

View file

@ -29,7 +29,7 @@ func createTestNetwork(networkType, networkName string, option options.Generic)
return network, nil
}
func TestSimplebridge(t *testing.T) {
func Testbridge(t *testing.T) {
defer netutils.SetupTestNetNS(t)()
ip, subnet, err := net.ParseCIDR("192.168.100.1/24")
if err != nil {
@ -49,7 +49,7 @@ func TestSimplebridge(t *testing.T) {
}
cidrv6.IP = ip
log.Debug("Adding a simple bridge")
log.Debug("Adding a bridge")
option := options.Generic{
"BridgeName": bridgeName,
"AddressIPv4": subnet,
@ -62,7 +62,7 @@ func TestSimplebridge(t *testing.T) {
"EnableIPForwarding": true,
"AllowNonDefaultBridge": true}
network, err := createTestNetwork("simplebridge", "testnetwork", option)
network, err := createTestNetwork("bridge", "testnetwork", option)
if err != nil {
t.Fatal(err)
}
@ -135,7 +135,7 @@ func TestDuplicateNetwork(t *testing.T) {
controller := libnetwork.New()
option := options.Generic{}
driver, err := controller.NewNetworkDriver("simplebridge", option)
driver, err := controller.NewNetworkDriver("bridge", option)
if err != nil {
t.Fatal(err)
}
@ -158,7 +158,7 @@ func TestDuplicateNetwork(t *testing.T) {
func TestNetworkName(t *testing.T) {
networkName := "testnetwork"
n, err := createTestNetwork("simplebridge", networkName, options.Generic{})
n, err := createTestNetwork("bridge", networkName, options.Generic{})
if err != nil {
t.Fatal(err)
}
@ -169,7 +169,7 @@ func TestNetworkName(t *testing.T) {
}
func TestNetworkType(t *testing.T) {
networkType := "simplebridge"
networkType := "bridge"
n, err := createTestNetwork(networkType, "testnetwork", options.Generic{})
if err != nil {
@ -182,7 +182,7 @@ func TestNetworkType(t *testing.T) {
}
func TestNetworkID(t *testing.T) {
networkType := "simplebridge"
networkType := "bridge"
n, err := createTestNetwork(networkType, "testnetwork", options.Generic{})
if err != nil {
@ -200,7 +200,7 @@ func TestDeleteNetworkWithActiveEndpoints(t *testing.T) {
"BridgeName": bridgeName,
"AllowNonDefaultBridge": true}
network, err := createTestNetwork("simplebridge", "testnetwork", option)
network, err := createTestNetwork("bridge", "testnetwork", option)
if err != nil {
t.Fatal(err)
}
@ -235,7 +235,7 @@ func TestUnknownNetwork(t *testing.T) {
"BridgeName": bridgeName,
"AllowNonDefaultBridge": true}
network, err := createTestNetwork("simplebridge", "testnetwork", option)
network, err := createTestNetwork("bridge", "testnetwork", option)
if err != nil {
t.Fatal(err)
}
@ -268,7 +268,7 @@ func TestUnknownEndpoint(t *testing.T) {
"AddressIPv4": subnet,
"AllowNonDefaultBridge": true}
network, err := createTestNetwork("simplebridge", "testnetwork", option)
network, err := createTestNetwork("bridge", "testnetwork", option)
if err != nil {
t.Fatal(err)
}

View file

@ -8,7 +8,7 @@ create network namespaces and allocate interfaces for containers to use.
// This option is only needed for in-tree drivers. Plugins(in future) will get
// their options through plugin infrastructure.
option := options.Generic{}
driver, err := controller.NewNetworkDriver("simplebridge", option)
driver, err := controller.NewNetworkDriver("bridge", option)
if err != nil {
return
}