Commit Graph

32 Commits

Author SHA1 Message Date
Frank Yang 07fc13e604 Fixes bug which makes restoring endpoint mess
Signed-off-by: Frank Yang <yyb196@gmail.com>
2017-08-03 18:33:23 +08:00
Flavio Crisciani 815171dcf9
Revert "Fixes bug that mistook gw6 for gw."
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-01 17:14:13 -07:00
Frank Yang 2cd3a73be6 Fixes bug that mistook gw6 for gw.
Signed-off-by: Frank Yang <yyb196@gmail.com>
2017-07-31 22:24:44 +08:00
Flavio Crisciani c6917f91f5
Add gosimple check
Add the gosimple tool check in the Makefile
Fix all the issues identified

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-06 09:42:38 -07:00
Madhu Venugopal 4dd1d9c502 Trust the endpoint state if we have a valid sandbox-id
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-02-02 14:46:59 -08:00
Alessandro Boch 82a12c3af3 Fix bug in link-local unmarshalling
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-21 10:17:38 -08:00
msabansal 0c0c7828b0 Default GW support for overlay networks
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-11-08 14:12:29 -08:00
Jana Radhakrishnan 344aa2f668 Ensure drivertable entries in joininfo is uptodate
The CopyTo function for joininfo is not copying the driver table entries
which then is missing when the endpoint is re-read for the store cache.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-02 14:06:41 -07:00
Lei Jitang be153a13e4 Add network restore to support docker live restore container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-06-13 23:48:00 -07:00
Alessandro Boch e3f81d62fe Allow to program Endpoint link-local addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-08 15:02:34 -07:00
Jana Radhakrishnan 632017b72a Add libnetwork agent mode support
libnetwork agent mode is a mode where libnetwork can act as a local
agent for network and discovery plumbing alone while the state
management is done elsewhere. This completes the support for making
libnetwork and its associated drivers to be completely independent of a
k/v store(if needed) and work purely based on the state information
passed along by some some external controller or manager. This does not
mean that libnetwork support for decentralized state management via a
k/v store is removed.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-05-02 18:19:32 -07:00
Jana Radhakrishnan ed939ef5c3 Add driver api enhancements for gossip
With the introduction of a driver generic gossip in libnetwork it is not
necessary for drivers to run their own gossip protocol (like what
overlay driver is doing currently) but instead rely on the gossip
instance run centrally in libnetwork. In order to achieve this, certain
enhancements to driver api are needed. This api aims to provide these
enhancements.

The new api provides a way for drivers to register interest on table
names of their choice by returning a list of table names of interest as
a response to CreateNetwork. By doing that they will get notified if a
CRUD operation happened on the tables of their interest, via the newly
added EventNotify call.

Drivers themselves can add entries to any table during a Join call by
invoking AddTableEntry method any number of times during the Join
call. These entries lifetime is the same as the endpoint itself. As soon
as the container leaves the endpoint, those entries added by driver
during that endpoint's Join call will be automatically removed by
libnetwork. This action may trigger notification of such deletion to all
driver instances in the cluster who have registered interest in that
table's notification.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-18 19:55:39 -07:00
Madhu Venugopal c0eb067e13 Force delete sandbox during sandboxCleanup
Stale sandbox and endpoints are cleaned up during controller init.
Since we reuse the exact same code-path, for sandbox and endpoint
delete, they try to load the plugin and it causes daemon startup
timeouts since the external plugin containers cant be loaded at that
time. Since the cleanup is actually performed for the libnetwork core
states, we can force delete sandbox and endpoint even if the driver is
not loaded.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-17 14:47:49 -08:00
aboch f942c0e64d Merge pull request #778 from chenchun/disable-default-gateway
Add a network option to disable default gateway
2015-12-03 13:51:43 -08:00
Chun Chen b1e94ca09a Add DisableGatewayService in JoinInfo to offering drivers the ability to disable default gateway
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-12-03 12:51:28 +08:00
Alessandro Boch 9ce24e77d3 Don't connect sbx to default gw nw if default static route is provided
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-12-02 20:00:27 -08:00
Alessandro Boch 1ee5a944f5 Fix in endpoint Info() method
- Make sure to return the proper value for the
  EndpointInfo interface in case of nil implementer

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-11-22 21:44:06 -08:00
Alessandro Boch 05fc05b184 Fix in DriverInfo()
- Retrieve info from default gateway network's peer endpoint
  if present

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-28 16:30:20 -07:00
Alessandro Boch 0c2be91253 libnetwork to handle allocation of ipv6
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-07 13:57:28 -07:00
Jana Radhakrishnan 25f496f771 Remove always-on watch for networks and endpoints
Always on watching of networks and endpoints can
affect scalability of the cluster beyond a few nodes.
Remove pro active watching and watch only the objects
you are interested in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:15:49 -07:00
Alessandro Boch 6315c9a4b6 libnetwork <-> ipam driver interaction
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -07:00
Tom Denham c9b7f3eb60 Remove unwanted lock
Fixes #545

Signed-off-by: Tom Denham <tom@tomdee.co.uk>
2015-09-17 18:07:46 -07:00
Jana Radhakrishnan a3db98ec00 Remove multiple interface in an endpoint
Currently the endpoint data model consists of multiple
interfaces per-endpoint. This seems to be an overkill
since there is no real use case for it. Removing it
to remove unnecessary complexity from the code.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-11 09:19:01 -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
Madhu Venugopal fb272a1f36 Fix endpoint ip data-store sync issue
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-18 19:07:00 -07:00
Alessandro Boch 496d267d96 Endpoint to provide ContainerInfo
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-11 16:06:58 -07:00
Madhu Venugopal 9c3695fae8 Reworked endpoint store operation to address a few cases
* Removed network from being marshalled (it is part of the key anyways)
* Reworked the watch function to handle container-id on endpoints
* Included ContainerInfo to be marshalled which needs to be synchronized
* Resolved multiple race issues by introducing data locks

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 23:59:29 -07:00
Madhu Venugopal 4d06bbd2e6 Fixing a few go-vet issues
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 04:32:10 -07:00
Tom Denham b646784859 Allow drivers to supply static routes for interfaces
Signed-off-by: Tom Denham <tom.denham@metaswitch.com>
2015-05-25 19:25:30 -07:00
Jana Radhakrishnan 647975a330 Modify driver Join api to only allow dst prefix
Currently the driver api allows the driver to specify the
full interface name for the interface inside the container.
This is not appropriate since the driver does not have the full
view of the sandbox to correcly allocate an unambiguous interface
name. Instead with this PR the driver will be allowed to specify
a prefix for the name and libnetwork and sandbox layers will
disambiguate it with an appropriate suffix.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-21 20:17:44 +00:00
Jana Radhakrishnan 7783fcd13f Move network types to types package
This is need to decouple types from netutils which has linux
dependencies. This way the client code which needs network types
can just pull in types package which makes client code platform
agnostic.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-20 20:28:46 +00: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