diff --git a/README.md b/README.md index 425dba9..744c388 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The goal of libnetwork is to deliver a robust Container Network Model that provi Please watch this space for updates on the progress. Currently libnetwork is nothing more than an attempt to modularize the Docker platform's networking subsystem by moving it into libnetwork as a library. - + Please refer to the [roadmap](ROADMAP.md) for more information. #### Using libnetwork @@ -23,10 +23,10 @@ There are many networking solutions available to suit a broad range of use-cases // Create a new controller instance controller := libnetwork.New() - // This option is only needed for in-tree drivers. Plugins(in future) will get + // 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 } @@ -37,7 +37,7 @@ There are many networking solutions available to suit a broad range of use-cases if err != nil { return } - + // For a new container: create a sandbox instance (providing a unique key). // For linux it is a filesystem path networkPath := "/var/lib/docker/.../4d23e" @@ -45,7 +45,7 @@ There are many networking solutions available to suit a broad range of use-cases if err != nil { return } - + // For each new container: allocate IP and interfaces. The returned network // settings will be used for container infos (inspect and such), as well as // iptables rules for port publishing. This info is contained or accessible @@ -62,7 +62,7 @@ There are many networking solutions available to suit a broad range of use-cases return } } - + // Set the gateway IP if err := networkNamespace.SetGateway(sinfo.Gateway); err != nil { return diff --git a/cmd/readme_test/readme.go b/cmd/readme_test/readme.go index ea55f27..ae01aa4 100644 --- a/cmd/readme_test/readme.go +++ b/cmd/readme_test/readme.go @@ -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 } diff --git a/cmd/test/main.go b/cmd/test/main.go index 3dedce3..b3ca6be 100644 --- a/cmd/test/main.go +++ b/cmd/test/main.go @@ -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) diff --git a/drivers/bridge/bridge.go b/drivers/bridge/bridge.go index 6e3d3a7..95e0a5e 100644 --- a/drivers/bridge/bridge.go +++ b/drivers/bridge/bridge.go @@ -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 @@ -96,7 +96,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 ( diff --git a/drivers/bridge/error.go b/drivers/bridge/error.go index ee28cd2..5ae28e9 100644 --- a/drivers/bridge/error.go +++ b/drivers/bridge/error.go @@ -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") diff --git a/libnetwork_test.go b/libnetwork_test.go index ad72a40..e9b2b9e 100644 --- a/libnetwork_test.go +++ b/libnetwork_test.go @@ -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) } @@ -134,7 +134,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) } @@ -157,7 +157,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) } @@ -168,7 +168,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 { @@ -181,7 +181,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 { @@ -199,7 +199,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) } @@ -234,7 +234,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) } @@ -267,7 +267,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) } diff --git a/network.go b/network.go index 9fccfc3..e729f85 100644 --- a/network.go +++ b/network.go @@ -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 }