Commit graph

2612 commits

Author SHA1 Message Date
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