Commit Graph

29 Commits

Author SHA1 Message Date
Madhu Venugopal cc4f27f6af Minor API modifications
* Modified NB API with self referential var-aarg for future proofing the APIs
* Modified Driver API's option parameter to be a Map of interface{}

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-01 10:49:25 -07:00
Jana Radhakrishnan e2d8531a40 - Added support for Join/Leave methods to Endpoint.
- Removed sandbox key argument for CreateEndpoint.
- Refactored bridge driver code to remove sandbox key.
- Fixed bridge driver code for gaps in ipv6 behavior
  observed during docker integration.
- Updated test code, readme code, README.md according
  api change.
- Fixed some sandbox issues while testing docker ipv6
  integration.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-29 14:49:32 +00:00
Alessandro Boch 35693a1a47 Issue #88: Handle default v4/v6 gw setting
- Basically this is porting docker PR #9381 to libnetwork
- Added a Config.Validate() method where to consolidate
  a priori validation of bridge configuration
- Have bridgeInterface store the current v4/v6 default gateways
- Introduced two setupStep functions to set the requested def gateways

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-28 13:48:28 -07:00
Madhu Venugopal 35a0dc89b7 Merge pull request #86 from aboch/utm
Libnetwork bridge to handle MTU option
2015-04-24 05:59:47 -07:00
Alessandro Boch 1fae5573d2 Refactor NetworkController interface
- To reflect work flow. NewDriver() => ConfigureDriver()
  and no NetworkDriver returned.
  libnetwork clients would refer to a driver/network type, then
  internally controller will retrieve the correspondent driver
  instance, but this is not a concern of the clients.
- Remove NetworkDriver interface
- Removed stale blank dependency on bridge in libnetwork_test.go

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-23 18:46:01 -07:00
Alessandro Boch 198e3d3ee9 Libnetwork bridge to handle MTU option
- This address one of the requirements of Issue #78
- Bridge MTU will be enforced on the veth pair ifaces
  for each endpoint being added to the network.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-23 18:42:38 -07:00
Madhu Venugopal 914ad10ea4 Merge pull request #84 from aboch/mao
Libnetwork bridge to handle --mac-address option
2015-04-23 16:40:07 -07:00
Alessandro Boch 69437b1009 Libnetwork bridge to handle --mac-address option
- This addresses one requirement from Issue #79
- Defined EndpointConfiguration struct for bridge driver
  which contains the user's preferred mac address for the
  sanbox interface

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-23 13:03:34 -07:00
Jana Radhakrishnan 565a7daa7a Merge pull request #82 from dave-tucker/simplebridge
Rename simplebridge to bridge
2015-04-23 11:22:44 -07:00
Dave Tucker f4fd5dacbf Rename simplebridge to bridge
Fixes #81

Signed-off-by: Dave Tucker <dt@docker.com>
2015-04-23 10:49:57 -07:00
Alessandro Boch 468ebf3816 Issue #68: In bridge.go driver remove veth on endpoint delete
- Store *Interface on endpoint create
- Remove from bridgeEndpoint ip params now available in Interface
- On endpoint delete attempt a removal of veth plugged into bridge
- (tested disabling defer netutils.SetupTestNetNS(t)() in libnetwrok_test)
- Fix bridge to  store endpoints per sandbox
- Fix bug in error.go which causes stack overflow
- Start bridge error string w/ lower case as per go convention

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-22 09:35:47 -07:00
Alessandro Boch 7d24e974cf Refactor driverapi, sandbox pkgs
- Move SanboxInfo and Interface structures in sandbox package
  (changed it to Info as per golint)
- Move UUID to new internal pkg types
- Updated .gitignore to ignore IDE project files

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-21 09:44:39 -07:00
Alessandro Boch 95958d7610 Enhance Endpoint interface
- Added new getter methods
- Modified signature of Network.CreateEndpoint()

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-20 03:21:01 -07:00
Jana Radhakrishnan e91ed59cb2 Changed all the naked error returns in bridge driver to proper error
types, except the naked error returns which were just prefixing
strings to previously returned error strings.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-17 02:50:22 +00:00
Alessandro Boch 3e6a889cd6 Port Allocator as a libnetwork package
DESCRIPTION:
  As part of bringing libnetwork bridge driver features
  in parity with docker/daemon/network/driver/bridge
  features (Issue #46), this commit addresses the
  bridge.RequestPort() API.

  Currenlty docker/api/server.go needs an hold of port
  allocator in order to reserve a transport port which
  will be used by the http server on the host machine,
  so that portallocator does not give out that port when
  queried by portmapper as part of network driver operations.

ISSUE:
  Current implementation in docker is server.go directly
  access portmapper and then portallocator from bridge pkg
  calling bridge.RequestPort(). This also forces that function
  to trigger portmapper initialization (in case bridge init()
  was not executed yet), while portmapper life cycle should
  only be controlled by bridge network driver.
  We cannot mantain this behavior with libnetwrok as this
  violates the modularization of networking code which
  libnetwork is bringing in.

FIX:
  Make portallocator a singleton, now both docker core and
  portmapper code can initialize it and get the only one instance
  (Change in docker core code will happen when docker code
  will migrate to use libnetwork), given it is being used for
  host specific needs.

NOTE:
  Long term fix is having multiple portallocator instances (so
  no more singleton) each capable to be in sync with OS regarding
  current port allocation.
  When this change comes, no change whould be required on portallocator'
  clients side, changes will be confined to portallocator package.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-16 17:29:13 -07:00
Jana Radhakrishnan b0a38a0d1b Fixed a bug in bridge driver where when the bridge already exists
the bridgeInterface.bridgeIPv4 is not getting initialized properly

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-16 13:56:52 +00:00
Jana Radhakrishnan e797f80ad4 Added driver specific config support
- Added api enhancement to pass driver specific config
  - Refactored simple bridge driver code for driver specific config
  - Added an undocumented option to add non-default bridges without
    manual pre-provisioning to help libnetwork testing
  - Reenabled libnetwork test to do api testing
  - Updated README.md

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-15 18:32:07 +00:00
Brent Salisbury d8f88b2afb Name/Mac generation and libcontainer dep removal
- Modified Mac address generation to match current standard
- Moved GenerateRandomName from libcontainer and removed the dependancy.
- Reduced entropy loop to 3 attempts.

Signed-off-by: Brent Salisbury <brent.salisbury@docker.com>
2015-04-14 18:10:52 -04:00
Jana Radhakrishnan 0a25032277 Converted IP address and gateway values to be proper types
rather than strings in the sandbox and driverapi protocol

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-14 01:36:58 +00:00
Jana Radhakrishnan 68ae284db5 Libnetwork refactor for container network model
- Added controller, network, endpoint and sandbox interfaces
    - Created netutils package for miscallaneous network utilities
    - Created driverapi package to break cyclic dependency b/w driver and libnetwork
    - Made libnetwork multithread safe
    - Made bridge driver multithread safe
    - Fixed README.md

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-13 21:40:50 +00:00
Alessandro Boch 1f3f37b2f8 Sync libnetwork code to latest docker/master
- Update: portmapper, portallocator, ipallocator
- Remove stale godep dependencies
- Update pkg/iptables and others godep to latest
- Update bridge code and test after above changes
- Merge with latest changes in libnetwork

The code is updated up to docker/master commit SHA 86d66d6273

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-10 13:50:58 -07:00
Jana Radhakrishnan 4ac519f7b6 - Added initial test cases for libnetwork api
- Introduce delete api

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-08 16:00:28 +00:00
Arnaud Porterie 38173fa22c Merge pull request #23 from aboch/iptables
Add implementation and test for setupIPTables()
2015-03-09 11:13:24 -07:00
Jana Radhakrishnan 91589f4948 Merge with docker/libnetwork
Signed-off-by: Jana Radhakrishnan <mrjana@socketplane.io>
2015-03-06 16:11:19 +00:00
Jana Radhakrishnan 2d16187d8c Refactor the drivers interface to get rid of reflect way
Signed-off-by: Jana Radhakrishnan <mrjana@socketplane.io>
2015-03-06 16:00:21 +00:00
Alessandro Boch 6311a96710 Add implementation and test for SetupIPTables()
- Port and refactor docker/damon/driver ip tables setup function
  into libnetwork.
- Taken care of golint guideline for CI to pass
- Ran one more time goimports for CI to pass...

Signed-off-by: Alessandro Boch <aboch@socketplane.io>
2015-03-05 23:37:11 -08:00
Arnaud Porterie 6424c7a875 Remove golint warnings
Fix all golint warnings, mostly by making exported types internal.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 13:29:28 -08:00
Arnaud Porterie b9bd3a7dd0 Add network name
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-02 10:17:12 -08:00
Arnaud Porterie 8ca185e2ee Move bridge to drivers/
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-24 11:29:06 -08:00