Commit Graph

158 Commits

Author SHA1 Message Date
Madhu Venugopal
bd00a055ee Link implementation in bridge driver
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-03 14:36:55 -07:00
Madhu Venugopal
ba38542e95 Ignoring Driver failure on Leave.
After some delibration, we think it is better not to hold onto the
sandbox resources if an explicit call to Leave fails by the Driver.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-03 07:29:24 -07:00
Jana Radhakrishnan
5025c5395f Merge pull request #102 from aboch/pm
Bridge to handle port mapping
2015-05-03 00:15:01 -07:00
Alessandro Boch
dd65231f1c Remove redundant code in endpoint.go
- JoinOption, LeaveOption, EndpointOption are all the same thing

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-02 23:55:37 -07:00
Alessandro Boch
18e3679789 Bridge to handle port mapping
- libnetwork cares for list of exposed ports, driver cares
  for list of port bindings. At endpoint creation:
  - list of exposed ports will be passed as libnetwork otion
  - list of port mapping will be passed as driver option

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-02 23:25:01 -07:00
Alessandro Boch
eecfd7acb5 Params of non-exported struct should be non-exported
- in error.go

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-02 17:30:20 -07:00
Alessandro Boch
3bb407a21f Re-arrange MAC election code for sandbox iface
- in bridge.go

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-02 17:30:11 -07:00
Jana Radhakrishnan
e321761977 Merge pull request #105 from mavenugo/joinleave
Join Leave Driver API and minor updates to the existing NB APIs
2015-05-01 13:52:01 -07:00
Madhu Venugopal
2e27ab5aad Join / Leave Driver API
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-01 13:38:26 -07:00
Madhu Venugopal
3686b72c56 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
Madhu Venugopal
b041485b68 Merge pull request #101 from aboch/vrd
Control scope of JoinOption functions
2015-04-30 13:49:14 -07:00
Alessandro Boch
6dcd957b12 Control scope of JoinOption functions
ISSUE:
- JoinOption type takes the exported interface Endpoint as parameter.
  This does not allows libnetwork to control the setter functions
  which will be executed by processOptions(). Client can now craft
  any func (e Endpoint), pass it to Endpoint.Join() and have it executed.
  Beside the fact this allows the client to shot himself in the foot,
  there seem not to be a real need in having the JoinOption take the
  Endpoint interface as parameter.

CHANGE:
- Changing the JoinOption signature to take a pointer to the unexported
  endpoint structure. So now libnetwork is the only one that can define
  the Join() method's options setter functions via the self referenced
  JoinOption[...] functions.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-30 10:49:31 -07:00
Madhu Venugopal
0e34c21f8c Merge pull request #100 from mrjana/cnm_integ
Add basic /etc/hosts file management support in libnetwork
2015-04-30 05:58:20 -07:00
Jana Radhakrishnan
95068e6583 Updated Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-30 06:32:52 +00:00
Jana Radhakrishnan
ce3965049e - Added Join option support
- Added basic /etc/hosts generation support in libnetwork

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-30 05:58:12 +00:00
Jana Radhakrishnan
b966b4a995 Added null driver support for handling --net=none and -n=false cases
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-30 05:56:59 +00:00
Madhu Venugopal
5b800ca696 Merge pull request #99 from mrjana/cnm_integ
Reorganize the libnetwork code to separate Controller, Network and Endpoint
2015-04-29 19:33:46 -07:00
Jana Radhakrishnan
aeeb2fa909 Reorganized the libnetwork code to seperate Controller, Network and Endpoint
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-30 01:25:01 +00:00
Jana Radhakrishnan
68ba9ca5aa Merge pull request #98 from aboch/icc
Port PR #11526 to libnetwork
2015-04-29 11:56:34 -07:00
Madhu Venugopal
e91f827b23 Merge pull request #95 from mrjana/cnm_integ
Add support for Join/Leave methods to Endpoint
2015-04-29 11:55:11 -07:00
Alessandro Boch
b7fc310643 Port PR #11526 to libnetwork
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-29 11:46:36 -07:00
Jana Radhakrishnan
d6c0c261a3 - 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
Jana Radhakrishnan
0a08d3a145 Merge pull request #93 from mavenugo/cli
libnetwork client
2015-04-28 20:55:06 -07:00
Madhu Venugopal
eb91f0ba93 Merge pull request #89 from aboch/wdyg
Issue #88: Handle default v4/v6 gw setting
2015-04-28 17:35:58 -07:00
Alessandro Boch
1abbe4d6fa 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
84a964114c libnetwork client base infra
This is an experiment by modularizing the client UI handler in libnetwork
while the actual UI hook to the docker chain can come from Docker Project.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-26 21:08:00 -07:00
Madhu Venugopal
4d6dec8c43 Added docker mflag package to Godeps
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-26 13:42:30 -07:00
Madhu Venugopal
31bacb525f Merge pull request #91 from aboch/gnames
Rename setGatewayIP() in sandbox pkg
2015-04-25 19:38:53 -07:00
Jana Radhakrishnan
d581ee510d Merge pull request #92 from mavenugo/integ_test
Initial bats based integration test infra for testing daemon network configs
2015-04-25 19:10:17 -07:00
Madhu Venugopal
d88d333e95 Merge pull request #90 from aboch/gqn
Provide Query API for NetworkController
2015-04-25 12:31:12 -07:00
Madhu Venugopal
c7b679e686 Initial bats based integration tests for testing daemon network configs
Pre-reqs :
* docker machine (https://github.com/docker/machine)
* bats (https://github.com/sstephenson/bats)
* virtualbox

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-25 07:33:48 -07:00
Alessandro Boch
efa85f73f7 Rename setGatewayIP() in sandbox pkg
- setGatewayIP() => programGateway() becsause it is
  causing confusion with setGateway() and setGatewayIPv6()

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-24 17:08:50 -07:00
Alessandro Boch
63e19f02fc Provide Query API for Network and Endpoint
- In NetworkController and Network respectively

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-24 16:56:52 -07:00
Madhu Venugopal
9c3c270d6f Merge pull request #74 from aboch/wlk
Add methods to walk Endpoints and Networks
2015-04-24 11:56:35 -07:00
Alessandro Boch
1e7b0b2caf Add methods to walk Endpoints and Networks
- From Network and Controller interfaces, respectively

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-24 08:44:00 -07:00
Madhu Venugopal
043a23ae12 Merge pull request #87 from mrjana/cnm_integ
Fix assortment of sandbox issues
2015-04-24 06:01:48 -07:00
Madhu Venugopal
1933403d30 Merge pull request #86 from aboch/utm
Libnetwork bridge to handle MTU option
2015-04-24 05:59:47 -07:00
Madhu Venugopal
966c9a8884 Merge pull request #85 from aboch/drv
Refactor NetworkController interface
2015-04-24 05:56:52 -07:00
Jana Radhakrishnan
61d75554ae - Re-enabled Bridge test case which got disabled because
lower case test case function name

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-24 05:18:03 +00:00
Jana Radhakrishnan
eca040df2b - Fixed an assortment of bugs in sandbox
- Added more test coverage to sandbox

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-24 05:17:50 +00:00
Alessandro Boch
70b7d259af 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
cfa284ed18 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
810a4676c2 Merge pull request #84 from aboch/mao
Libnetwork bridge to handle --mac-address option
2015-04-23 16:40:07 -07:00
Alessandro Boch
75d7d43f9c 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
9bdba881be Merge pull request #82 from dave-tucker/simplebridge
Rename simplebridge to bridge
2015-04-23 11:22:44 -07:00
Madhu Venugopal
d17b3c32b2 Merge pull request #69 from aboch/cup
Issue #68: In bridge.go driver remove veth on endpoint delete
2015-04-23 11:06:06 -07:00
Dave Tucker
ee4b5cc7e3 Rename simplebridge to bridge
Fixes #81

Signed-off-by: Dave Tucker <dt@docker.com>
2015-04-23 10:49:57 -07:00
Alessandro Boch
67ccf8ec77 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
Madhu Venugopal
3b184f863f Merge pull request #77 from fmzhen/test-dev
Add TestSandboxInfoEqual in sandbox_test.go
2015-04-21 20:55:28 -07:00
Mingzhen Feng
3d34a574ad Add TestSandboxInfoEqual in sandbox_test.go
Signed-off-by: Mingzhen Feng <fmzhen@zju.edu.cn>
2015-04-22 10:04:03 +08:00