Commit graph

3067 commits

Author SHA1 Message Date
Alessandro Boch
1739626f4d NewNetwork and CreateEndpoint to validate resource name
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-10 10:59:58 -07:00
Jana Radhakrishnan
5284149bc8 Merge pull request #132 from mavenugo/master
Fixed some convoluted texts in remote.md and fixed a remote driver bug
2015-05-10 10:56:38 -07:00
Jana Radhakrishnan
7aeea5de8d Merge pull request #134 from mavenugo/proxy
Added more test coverage for the portmapper package
2015-05-10 10:55:30 -07:00
Jana Radhakrishnan
7f7d9abd87 Make endpoint Join and Leave multi-thread safe
- Refactored the Join/Leave code so they are synchronized across multiple go-routines
    - Added parallel test coverage to test mult-thread access to Join/Leave
    - Updated sandbox code to revert back to caller namespace when removing interfaces
    - Changed the netns path to /var/run/netns so the cleanup is simpler on machine
      reboot scenario

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-10 17:36:04 +00:00
Madhu Venugopal
2fc4f3154f Added more test coverage for portmapper package.
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-10 16:53:56 +00:00
Mingzhen Feng
0db03ebaa3 Add some tests
Signed-off-by: Mingzhen Feng <fmzhen@zju.edu.cn>
2015-05-08 15:00:59 +08:00
Madhu Venugopal
fd04ef2d00 Cleaning up the Endpoint Joins with proper defered Leave
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-07 14:09:16 -07:00
Madhu Venugopal
27d34d67ab Fixed some convoluted texts in remote.md and fixed a remote driver bug
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-07 11:55:46 -07:00
bin liu
e1003fb078 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2015-05-07 09:22:06 +00:00
Jana Radhakrishnan
03c18818ed Merge pull request #128 from kunalkushwaha/master
Small typo fixed
2015-05-06 22:02:53 -07:00
Madhu Venugopal
904a313396 Remote Driver Registration
This commits brings in a functionality for remote drivers to register
with LibNetwork. The Built-In remote driver is responsible for the
actual "remote" plugin to be made available.

Having such a mechanism makes libnetwork core not dependent on any
external plugin mechanism and also the Libnetwork NB apis are free of
Driver interface.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-06 21:45:30 -07:00
Madhu Venugopal
0d45fb66b3 Added remote driver design doc
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-06 20:16:43 -07:00
unknown
df3cde525a Small typo fixed
Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2015-05-07 11:11:34 +09:00
Jana Radhakrishnan
067e8977d5 Updated godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 23:52:50 +00:00
Jana Radhakrishnan
9714bcac87 Brought in iptables package into libnetwork.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 23:52:50 +00:00
Jana Radhakrishnan
25102c6e4d Merge pull request #123 from mavenugo/docs
Updated Design, Readme and Roadmap Documents
2015-05-06 15:45:51 -07:00
Jana Radhakrishnan
d10b8aca74 Updated Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 22:26:58 +00:00
Jana Radhakrishnan
9a5217b514 Copied etchosts and resolvconf packages to libnetwork.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 22:26:58 +00:00
Madhu Venugopal
142825b2f3 Updated Design Document
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-06 13:38:16 -07:00
Madhu Venugopal
570a76384a Handled endpoint delete with active containers attached to it
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-06 13:04:39 -07:00
Dave Tucker
4f7eb502bf Add design documentation
This is an intial pass at the design docs.
Hopefully, we can merge this and then start accepting PRs to improve it!

Signed-off-by: Dave Tucker <dt@docker.com>
2015-05-06 11:53:55 -07:00
Jana Radhakrishnan
3919b126a9 Added support for network specific enable ipv6 label
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 17:43:34 +00:00
Jana Radhakrishnan
94a9f12280 Moved most of the driver configuration to network configuration.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 17:43:24 +00:00
Jana Radhakrishnan
c9b54861e7 - Moved label definitions to a new package
- Added a network scope well-defined label
  to enable ipv6

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 17:21:19 +00:00
Alessandro Boch
dc3a4a007c In bridge.go: Join(), Leave(), getnetwork() are not thread safe
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-05 19:07:05 -07:00
Jana Radhakrishnan
ff36e97f45 Properly handle Leave by
- Removing interface from the sandbox
  - Deleting Iptable rules in the bridge driver

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 00:34:38 +00:00
Jana Radhakrishnan
f055e06f3a Added RemoveInterface support to sandbox.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 00:34:38 +00:00
Dave Tucker
8c2d72096f Don't fail the build on coveralls upload
If we can't upload to coveralls, don't fail the build.

Goveralls and Coveralls have been a little flaky and started throwing
http 422 errors, although I still see coverage being reported.

It's best in the interim to ignore these, although this should be
removed in future when the service is more stable

Signed-off-by: Dave Tucker <dt@docker.com>
2015-05-06 00:49:41 +01:00
Alessandro Boch
ec4e1da3c5 Separate ExposedPorts from PortBindings in libnetwork API
- Fix missing code in tests in 64cceb37ad1c16884d709fd49fba34e8a99d8c41

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-05 16:17:17 -07:00
Mingzhen Feng
8265de6325 chang the type of ports form PortBinding to TransportPort in link.go
Signed-off-by: Mingzhen Feng <fmzhen@zju.edu.cn>
2015-05-05 16:17:17 -07:00
Jana Radhakrishnan
3b8b2ffee8 - Changed ContainerConfiguration to simply use strings
- Made ContainerConfiguration fields to be exported so
  options package can access them.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 20:52:12 +00:00
Alessandro Boch
eb98e212cb Reuse existing docker chain constant in link.go
- in bridge driver

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-04 23:53:32 -07:00
Alessandro Boch
706c01073d CreateOptionPortMapping to store a copy of the passed bindings
- Given this will be internal data, make a defensive copy to
  protect from client inadvertently modifications.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-04 23:45:07 -07:00
Madhu Venugopal
d4851b95ec Incorrect assumption with golang net package causes Overlapping IP
using a len(net.IP) to check for ipv4 or ipv6 is a bad idea.
And that was exactly done in NetworkOverlaps() function with the
assumption that any ipv4 net.IP will be of 4 bytes. Golang Net package
makes no such assumptions.

This assumption actually broke a particular use-case where the
NetworkOverlaps fails to identify a genuine overlap and that causes
datapath issues.

With this fix, we explicitely check for v4 or v6

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-04 22:31:16 -07:00
Jana Radhakrishnan
55099e9656 - Removed sandbox override option from the driver.
- Reworked the host network mode support by introducing
  a new JoinOption.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 04:26:23 +00:00
Jana Radhakrishnan
a983569c0c Added mac address to EndpointInfo
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 03:27:34 +00:00
Jana Radhakrishnan
560d156e36 Replaced all proto numbers in netutils with the defined const
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 00:16:36 +00:00
Jana Radhakrishnan
db2f7c6f28 Added support for /etc/resolv.conf
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 00:16:36 +00:00
Jana Radhakrishnan
4399989c53 Updated Godeps to the latest versions of docker packages.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 00:16:36 +00:00
Jana Radhakrishnan
5f8bfa8ade Added "host" driver and test code.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 00:16:25 +00:00
Jana Radhakrishnan
66eb3e1cd4 - Added support for JoinInfo so that driver can override certain
container config.
- Added JoinOption processing for extra /etc/hosts record.
- Added support for updating /etc/hosts entries of other containers.
- Added sandbox support for adding a sandbox without the OS level create.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 00:09:11 +00:00
Jana Radhakrishnan
68cae04fe9 Fixed a bug in bridge driver when docker0 has no IP
address it doesn't select and configure a proper IP address.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 00:09:11 +00:00
Madhu Venugopal
def2a1192f Merge pull request #110 from aboch/ed
Provide API to retrieve Endpoint operational data
2015-05-04 16:50:11 -07:00
Madhu Venugopal
30e2ee9793 Fix a minor but in utils parsing UDP/TCP ports
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-04 16:28:51 -07:00
Alessandro Boch
56741e7d60 Provide API to retrieve Endpoint operational data
- from the driver

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-04 14:54:48 -07:00
Madhu Venugopal
446b158581 Link implementation in bridge driver
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-03 14:36:55 -07:00
Madhu Venugopal
95c5eb2856 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
Alessandro Boch
da97978469 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
da1cddc320 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
781bcc94a7 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
bfc5721970 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
Madhu Venugopal
9db6a1b8e4 Join / Leave Driver API
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-01 13:38:26 -07:00
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
Alessandro Boch
0d3ad0eaee 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
Jana Radhakrishnan
4bf442a510 Updated Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-30 06:32:52 +00:00
Jana Radhakrishnan
b8f81862d0 - 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
d684600cdf 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
Jana Radhakrishnan
713ff79ed5 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
b9a9f9117a Merge pull request #98 from aboch/icc
Port PR #11526 to libnetwork
2015-04-29 11:56:34 -07:00
Alessandro Boch
d438fd59cd Port PR #11526 to libnetwork
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-29 11:46:36 -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
Jana Radhakrishnan
144a42267b Merge pull request #93 from mavenugo/cli
libnetwork client
2015-04-28 20:55:06 -07: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
263ee2dbbb 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
d152bb91c4 Added docker mflag package to Godeps
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-26 13:42:30 -07:00
Madhu Venugopal
5c442d3c76 Merge pull request #91 from aboch/gnames
Rename setGatewayIP() in sandbox pkg
2015-04-25 19:38:53 -07:00
Jana Radhakrishnan
69177a73a4 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
8f63aa82b0 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
21ed154c79 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
6a5e4a83e4 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
Alessandro Boch
1c7c0f371b 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
2b3644edd5 Merge pull request #87 from mrjana/cnm_integ
Fix assortment of sandbox issues
2015-04-24 06:01:48 -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
Jana Radhakrishnan
6e80af6ee8 - 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
c6fd92a565 - 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
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
Madhu Venugopal
584aaeac36 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
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
Mingzhen Feng
3da12c7219 Add TestSandboxInfoEqual in sandbox_test.go
Signed-off-by: Mingzhen Feng <fmzhen@zju.edu.cn>
2015-04-22 10:04:03 +08: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
Jana Radhakrishnan
dcbb4c9928 Merge pull request #76 from mbanikazemi/75-typos
Fixing a few typos
2015-04-20 21:25:09 -07:00
Madhu Venugopal
2e10d9197e Merge pull request #66 from aboch/net
Add Network method to return list of endpoints
2015-04-20 12:13:26 -07:00
Mohammad Banikazemi
dee9e06bbb Fixing a few typos
Signed-off-by: Mohammad Banikazemi <mbanikazemi@gmail.com>
2015-04-20 13:08:09 -04: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
Madhu Venugopal
077d7d4895 Merge pull request #67 from liubin/fixtypos
fix some typos
2015-04-20 03:17:37 -07:00
Madhu Venugopal
1bf2cf18bd Merge pull request #65 from aboch/godeps
Update Godeps docker/pkg/common => /stringid
2015-04-20 03:16:41 -07:00
bin liu
a004b52ab3 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2015-04-20 04:12:54 +00:00
Alessandro Boch
f151cc23ab Add Network method to return list of endpoints
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-17 23:14:51 -07:00
Alessandro Boch
88eb07fb8d Update Godeps docker/pkg/common => /stringid
- pkg/common was renamed to pkg/stringid
- removed stale dep on libcontainer/utils

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-17 21:46:21 -07:00
Alessandro Boch
8098113830 Fix libnetwork_test.go
- It is working on default netns, leaving many
  vethxxx to cleanup after it runs

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-17 21:18:55 -07:00
Maru
0957eed04b Minor language cleanup in ROADMAP.md 2015-04-17 15:31:21 -07:00
Tom Wilkie
d449658d91 Expose Endpoint IDs in their public interface. 2015-04-17 14:55:32 +00: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
38ea74e2b5 - Fixed the makefile which was not checking failures in test code
- Cleaned up the makefile to remove output clutter

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-16 19:00:36 +00: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
56c3adda07 - Added more testcases for libnetwork API testing
- Added new error types for all of libnetwork errors

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-16 05:15:57 +00:00
Jana Radhakrishnan
ec7d417a37 Added a test binary to test README.md code
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-16 05:04:31 +00:00
Dave Tucker
8fe2d88db1 Fix typos and formatting in docs. Add Godoc badge.
Signed-off-by: Dave Tucker <dt@docker.com>
2015-04-16 00:06:02 +01: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
Madhu Venugopal
f63c19f390 Merge pull request #50 from dave-tucker/badges
Test Coverage and Build Status
2015-04-14 08:47:22 -07:00
Dave Tucker
2c797384ff Report Code Coverage and Add Status Badges
- Update Makefile to generate coverage details when running the tests
- Update CircleCI to use the Makefile
- Add Build and Coverage Badges to README

Closes #20

Signed-off-by: Dave Tucker <dt@docker.com>
2015-04-14 16:19:55 +01:00
Jana Radhakrishnan
6c0ffdd70a Added unsupported implementations for sandbox and sandbox
test code

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-14 04:53:02 +00: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
53c755b79d Updated godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-13 21:41:03 +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
2216885f11 Merge pull request #36 from mavenugo/master
Added initial README and ROADMAP files
2015-04-10 11:10:49 -07:00
Jana Radhakrishnan
2d364e2c34 - Added support to bridgeNetwork.Link
- Removed MAC and MTU configuration via AddInterface

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-10 16:45:59 +00:00
Madhu Venugopal
7b05ee2ac4 Added initial README and ROADMAP files
Fixes #9

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-10 05:14:31 -07:00
Madhu Venugopal
d6cc62a13b Merge pull request #34 from aboch/portmapper
Issue #33: Move portmapper and portallocator into libnetwork
2015-04-09 16:45:14 -07:00
Jana Radhakrishnan
d1a6ee35ea Run libnetwork test case only when it's specifically enabled
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-09 20:48:13 +00:00
Alessandro Boch
5d7b430801 Issue #33: Move portmapper and portallocator into libnetwork
- As they provide network translation functionalities,
  they should be part of libnetwork
- In driver/bridge/setup_ip_tables.go remove depenency
  on docker/daemon/networkdriver

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-09 11:05:02 -07:00
Madhu Venugopal
724948d6ed Merge pull request #26 from aboch/ipam
Issue #18: IP Allocator rework
2015-04-08 17:47:19 -07:00
Jana Radhakrishnan
d27976fec0 Merge pull request #30 from dave-tucker/Makefile-redux
Add Makefile
2015-04-08 15:54:58 -07:00
Madhu Venugopal
ea66cde5e3 Merge pull request #31 from dave-tucker/docs
Add Project Documentation
2015-04-08 12:05:10 -07:00
Dave Tucker
bc59294da8 Point to Docker contrib guidelines in README
Updates #9 and Fixes #21

Signed-off-by: Dave Tucker <dt@docker.com>
2015-04-08 17:25:08 +01:00
Dave Tucker
18d485a466 Add Makefile
Fixes #27

Signed-off-by: Dave Tucker <dt@docker.com>
2015-04-08 17:18:17 +01: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
Dave Tucker
f76372ed74 Add MAINTAINERS
Fixes #22

Signed-off-by: Dave Tucker <dt@docker.com>
2015-04-01 14:43:06 +01:00
Alessandro Boch
68d223a0e0 Issue #18: IP Allocator rework
- Move ipallocator package into libnetwork
- Also ported network utility functions and their tests in libnetwork:
  docker/daemon/networkdriver/utilg.go => libnetwork/utils.go
  docker/daemon/networkdriver/network_test.go => libnetwork/utils_test.go
- Changed drivers/setup_device.go and setup_ipv4.go to reuse functions in
  utils.go, instead of redefining internally.
- Modified utils to use vishvananda/netlink instead of libcontainer/netlink

Signed-off-by: Alessandro Boch <aboch@socketplane.io>
2015-03-24 13:57:59 -07:00
Jana Radhakrishnan
f2d7564f2c Resolve Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-03-12 04:07:46 +00:00
Jana Radhakrishnan
694c5ee788 Reimplement create namespace and move interafec to ns without reexec
This removes the dependency on reexec so that libnetwork can be used
as a library.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-03-12 04:07:34 +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
fc6b36e2bb Fix Godeps in CI
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-05 00:58:37 -08:00
Arnaud Porterie
5012cdf548 Merge pull request #14 from icecrime/godeps
Use Godeps
2015-03-04 19:26:09 -08:00
Arnaud Porterie
db5d4c3de3 Use Godeps
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 18:59:03 -08:00
Arnaud Porterie
0ac3833edb Circle CI
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 18:05:25 -08:00
Arnaud Porterie
2457d2549f Fix govet warnings
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 14:56:22 -08:00
Arnaud Porterie
263dd22fe3 Merge pull request #12 from docker/golint
Remove golint warnings
2015-03-04 14:50:45 -08:00
Arnaud Porterie
edebcebfee Circle CI
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 14:35:58 -08:00
Arnaud Porterie
e718ea9d2a Circle CI
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 14:34:26 -08:00
Arnaud Porterie
4e22b7b1f7 Add circle.yml
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 14:14:38 -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
58a3934282 Add a diagnostic message to ip forwading code
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 11:37:16 -08:00
Arnaud Porterie
8305579ffc Merge pull request #3 from aboch/master
Add implementation and test for SetIPForwarding()
2015-03-04 11:18:13 -08:00
Alessandro Boch
e40794cdc4 Fix minor static analysis issue in setup_ipv4.go
Signed-off-by: Alessandro Boch <aboch@socketplane.io>
2015-03-04 11:14:03 -08:00
Alessandro Boch
80809c42c6 Add implementation and test for SetIPForwarding()
- Addressed Arnaud's comments

Signed-off-by: Alessandro Boch <aboch@socketplane.io>
2015-03-04 10:24:18 -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
ba111871ea Renaming and comments
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-27 09:34:30 -08:00
Arnaud Porterie
cb96e4149d Test coverage
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-27 09:11:53 -08:00
Arnaud Porterie
94e8db8774 Next steps
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-26 17:17:45 -08:00
Arnaud Porterie
882f4d7e74 Add FixedCIDRv6 test
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-24 18:55:52 -08:00
Arnaud Porterie
3845ec20c4 Test coverage on bridge
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-24 18:41:17 -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
Arnaud Porterie
38f01266e3 Add tests
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-24 11:19:00 -08:00
Arnaud Porterie
3125c1f7c7 WIP - Code moves
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-22 21:42:34 -08:00
Arnaud Porterie
4a8b8498a7 WIP - Remove commented code
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-22 21:36:25 -08:00
Arnaud Porterie
46864de1d7 WIP - Fixed CIDR v4 and v6
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-22 21:32:48 -08:00
Arnaud Porterie
796d58af9e WIP - Bridge refactoring
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-22 21:11:12 -08:00
Arnaud Porterie
1f3b1febc7 WIP - Bridge refactoring
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-22 17:58:52 -08:00
Arnaud Porterie
76a8cbba11 WIP - Bridge refactoring
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-22 17:24:22 -08:00
Arnaud Porterie
8ad4ec910b Generic argument passing to drivers
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-20 09:12:29 -08:00
Arnaud Porterie
79ae90940c Generic options model
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-19 22:44:51 -08:00
Arnaud Porterie
7d4450e647 Unexport reexec symbols
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-19 17:44:48 -08:00
Arnaud Porterie
8ebeb1da5c Rename strategy to driver
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-19 17:37:53 -08:00
Arnaud Porterie
0d29ca540f Initial import
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-19 17:30:18 -08:00
Arnaud Porterie
d7c688f0f6 Initial commit 2015-02-19 17:20:15 -08:00