Commit Graph

29 Commits

Author SHA1 Message Date
Jana Radhakrishnan f76409b411 Add support to accepting arbitrary network ID
Currently the libnetwork function `NewNetwork` does not allow
caller to pass a network ID and it is always generated internally.
This is sufficient for engine use. But it doesn't satisfy the needs
of libnetwork being used as an independent library in programs other
than the engine. This enhancement is one of the many needed to
facilitate a generic libnetwork.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-15 12:34:21 -07:00
David Bellotti 1c3322febb Fix up example code
- runs to completion without error
- demonstrates info available when using bridge network driver

Closes #837

Signed-off-by: Gabe Rosenhouse <grosenhouse@pivotal.io>
2015-12-23 11:47:14 -08:00
Madhu Venugopal 5ffd02bf23 Updating README
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-11-24 20:29:50 -08:00
Chun Chen 3ff8b75315 Fix outdated docs and comments
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-22 23:47:44 +08:00
Jana Radhakrishnan 900aca112b Push driver config during `Init`
Currently the driver configuration is pushed through a separate
api. This makes driver configuration possible at any arbitrary
time. This unncessarily complicates the driver implementation.
More importantly the driver does not get access to it's
configuration before it can do the handshake with libnetwork.
This make the internal drivers a little bit different to
external plugins which can get their configuration before the handshake
with libnetwork.

This PR attempts to fix that mismatch between internal drivers and
external plugins.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-19 08:43:34 -07:00
Alessandro Boch 9a47be244a Introduce Sandbox entity
- Maps 1 to 1 with container's networking stack
- It holds container's specific nw options which
  before were incorrectly owned by Endpoint.
- Sandbox creation no longer coupled with Endpoint Join,
  sandbox and endpoint have now separate lifecycle.
- LeaveAll naturally replaced by Sandbox.Delete
- some pkg and file renaming in order to have clear
  mapping between structure name and entity ("sandbox")
- Revisited hosts and resolv.conf handling
- Removed from JoinInfo interface capability of setting hosts and resolv.conf paths
- Changed etchosts.Build() to first write the search domains and then the nameservers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 11:19:02 -07:00
wulonghui 677f9b7d7e Fix example package error 2015-08-04 11:14:01 +08:00
TianHuan 0352dc3f83 FIX incorrect usage about libnetwork.New() in README.md
libnetwork.New() should return a controller and an error. The
example in README.md ignore the error now, which will let the
codes can not be compiled by Go.
2015-07-20 21:59:05 +08:00
Alex Chan 86f32c245b Minor spelling fixes in documentation and code comments 2015-06-26 11:02:54 +01:00
Madhu Venugopal f8eb4da90c Moved the TOML based Configuration to dnet
The configuration format for docker runtime is based on daemon flags and
hence adjusting the libnetwork configuration to accomodate it by moving
the TOML based configuration to the dnet tool.

Also changed the controller configuration via options

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-12 12:46:12 -07:00
Jana Radhakrishnan 39cf9597d0 Remove container data return value from Join
Now that Endpoint interface has the Info method there is no
need to return container data as a return value in the Join
method. Removed the return value and fixed all the callers.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-29 20:11:02 +00:00
Madhu Venugopal 7bf5bdeb5a TOML based Configuration support for libnetwork
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:40 -07:00
Jana Radhakrishnan d8ba1e2310 Driver api refactor
Refactored the driver api so that is aligns well with the design
of endpoint lifecycle becoming decoupled from the container lifecycle.
Introduced go interfaces to obtain address information during CreateEndpoint.
Go interfaces are also used to get data from driver during join.
This sort of deisgn hides the libnetwork specific type details from drivers.

Another adjustment is to provide a list of interfaces during CreateEndpoint. The
goal of this is many-fold:
     * To indicate to the driver that IP address has been assigned by some other
       entity (like a user wanting to use their own static IP for an endpoint/container)
       and asking the driver to honor this. Driver may reject this configuration
       and return an error but it may not try to allocate an IP address and override
       the passed one.
     * To indicate to the driver that IP address has already been allocated once
       for this endpoint by an instance of the same driver in some docker host
       in the cluster and this is merely a notification about that endpoint and the
       allocated resources.
     * In case the list of interfaces is empty the driver is required to allocate and
       assign IP addresses for this endpoint.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-18 22:36:00 +00:00
Madhu Venugopal a8556518f6 Updated Design Document
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-06 13:38:16 -07:00
Jana Radhakrishnan 26779b6fea - 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 f42056ad40 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 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
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
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 c60935a41a 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
Dave Tucker 58f62a22cd 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 29f28ca925 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
Dave Tucker e6f2ce6b70 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 c14c967d85 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
Madhu Venugopal b343267c93 Added initial README and ROADMAP files
Fixes #9

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-10 05:14:31 -07:00
Dave Tucker 26f518039c 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
Arnaud Porterie eaf2e16800 Circle CI
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-04 18:05:25 -08:00
Arnaud Porterie cef46b121f Next steps
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-26 17:17:45 -08:00
Arnaud Porterie 2793ace55e Initial commit 2015-02-19 17:20:15 -08:00