Commit Graph

16 Commits

Author SHA1 Message Date
Alessandro Boch 6d3fa9e0f2 Migrate libnetwork to use netlink.Handle
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-08 21:05:36 -07:00
Alessandro Boch af3eb25d44 Phase-2 bridge driver changes to support IPAM
- Set bridge ipv4 address when bridge is present
- IPv6 changes for bridge
- Convert unit tests to the new model

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-08 16:22:03 -07:00
David Calavera cc02894a50 Move test specific functions to a testutils package.
This way we won't vendor test related functions in docker anymore.
It also moves netns related functions to a new ns package to be able to
call the ns init function in tests. I think this also helps with the
overall package isolation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-07 13:33:28 -04:00
Jana Radhakrishnan 33780a2ed5 Fix go fmt errors in the build
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-03 16:47:30 -07:00
Jana Radhakrishnan e02d88b716 Merge pull request #443 from aboch/mb
Fixes ip allocation for multi bridge networks
2015-09-03 16:30:19 -07:00
Jana Radhakrishnan bcd996f4c3 Explicitly set namespace for all network operations
Make sure to always explicitly set namespace for all
kernel bound network operations irrespective of whether
the operation is performed in init namespace or a user
defined namespace. This already happens for user defined
netns. But doesn't happen for initial netns that libnetwork
runs in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-01 14:00:58 -07:00
Alessandro Boch cd3fbc2a95 Fixes ip allocation for multi bridge networks
- Do not discard errors on ip allocation for gw and bridge
- Release addresses on network delete
- Add some context on top of ipallocator returned error
- Create ip allocator instance at driver creation, not at package init,
  otherwise this affects bridge test code where ip db is carried over
  test functions

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 20:39:30 -07:00
Alessandro Boch e8771c868e Bug in bridge network mask
- that was causing all networks to be /24

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-03 16:11:06 -07:00
Alessandro Boch 6461057521 Misc fixes to ipallocator & bridge driver about FixedCIDR
- NetworkRange() function on which ipallocatore relies
  to compute the subnet limits has a bug in computing the upper limit IP
- in case container subnet is specified (fixedCIDR), bridge driver to
  reserve bridge and gateway addresses only if they belong to the container
  subnet
- Make ipallocator more robust in using converting the passed network
  to a canonical one before using it as a key in its public APIs

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-07-27 18:12:33 -07:00
Alessandro Boch 5d9c59e523 Support network options in rest api
- Also unexporting configuration structures in bridge
- Changes in dnet/network.go to set bridge name = network name

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-23 20:12:29 -07: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
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
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
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
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 8ca185e2ee Move bridge to drivers/
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-02-24 11:29:06 -08:00