summaryrefslogtreecommitdiff
path: root/libnetwork/drivers/remote
Commit message (Collapse)AuthorAgeFilesLines
* libnet: convert to new-style driver registrationCory Snider2023-01-271-2/+10
| | | | | | | | | | | | | | | | | Per the Interface Segregation Principle, network drivers should not have to depend on GetPluginGetter methods they do not use. The remote network driver is the only one which needs a PluginGetter, and it is already special-cased in Controller so there is no sense warping the interfaces to achieve a foolish consistency. Replace all other network drivers' Init functions with Register functions which take a driverapi.Registerer argument instead of a driverapi.DriverCallback. Add back in Init wrapper functions for only the drivers which Swarmkit references so that Swarmkit can continue to build. Refactor the libnetwork Controller to use the new drvregistry.Networks and drvregistry.IPAMs driver registries in place of the legacy ones. Signed-off-by: Cory Snider <csnider@mirantis.com>
* refactor: move from io/ioutil to io and os packageEng Zer Jun2021-08-271-2/+1
| | | | | | | | The io/ioutil package has been deprecated in Go 1.16. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* libnetwork: remove unused "testutils" importsSebastiaan van Stijn2021-08-181-1/+0
| | | | | | | Perhaps the testutils package in the past had an `init()` function to set up specific things, but it no longer has. so these imports were doing nothing. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Fixup libnetwork lint errorsBrian Goff2021-06-011-2/+2
| | | | Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Fix issues running libnetwork tests.Brian Goff2021-06-011-4/+17
| | | | | | | | libnetwork does different stuff depending on if you are running the tests in a container or not... without telling it we are in a container a bunch of the tests actually fail. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Fix libnetwork importsBrian Goff2021-06-013-12/+12
| | | | | | | | | After moving libnetwork to this repo, we need to update all the import paths for libnetwork to point to docker/docker/libnetwork instead of docker/libnetwork. This change implements that. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Spelling fixesJosh Soref2018-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * addresses * assigned * at least * attachments * auxiliary * available * cleanup * communicate * communications * configuration * connection * connectivity * destination * encountered * endpoint * example * existing * expansion * expected * external * forwarded * gateway * implementations * implemented * initialize * internally * loses * message * network * occurred * operational * origin * overlapping * reaper * redirector * release * representation * resolver * retrieve * returns * sanbdox * sequence * succesful * synchronizing * update * validates Signed-off-by: Josh Soref <jsoref@gmail.com>
* Use new plugin interfaces provided by plugin pkgBrian Goff2018-06-222-9/+66
| | | | | | | | | | | | | The use of `Client()` on v2 plugins is being deprecated so that we can be more flexible on the protocol used for plugins. This means checking specifically if the plugin implements the `Client() *plugins.Client` interface for V1 plugins, and for v2 plugins building a the client manually. Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit 45824a226b8a220d6f189c2d25fe16f9efc83db9) Signed-off-by: selansen <elango.siva@docker.com>
* Update logrus to v1.0.1Derek McGowan2017-08-071-1/+1
| | | | | | | Fix case sensitivity issue Update docker and runc vendors Signed-off-by: Derek McGowan <derek@mcgstyle.net>
* Add ConnectivityScope capability for network drivers along with scope ↵Alessandro Boch2017-05-123-3/+18
| | | | | | | | | | | | | | | | | | | | | network option - It specifies whether the network driver can provide containers connectivity across hosts. - As of now, the data scope of the driver was being overloaded with this notion. - The driver scope information is still valid and it defines whether the data allocation of the network resources can be done globally or only locally. - With the scope network option, user can now force a network as swarm scoped regardless of the driver data scope. - In case the network is configured as swarm scoped, and the network driver is multihost capable, a network DB instance will be launched for it. Signed-off-by: Alessandro Boch <aboch@docker.com>
* swarm mode network inspect should provide cluser-wide task detailsSanthosh Manohar2017-03-101-0/+4
| | | | Signed-off-by: Santhosh Manohar <santhosh@docker.com>
* Merge pull request #1599 from mavenugo/v0.9Santhosh Manohar2017-01-041-1/+1
|\ | | | | Make use of GetAllManagedPluginsForCap to avoid loading v1-plugins
| * Make use of GetAllManagedPluginsForCap to avoid loading v1-pluginsMadhu Venugopal2017-01-041-1/+1
| | | | | | | | | | | | Read this for more details : https://github.com/docker/docker/pull/29665 Signed-off-by: Madhu Venugopal <madhu@docker.com>
* | Merge pull request #1568 from likel/refactorAlessandro Boch2016-12-292-6/+8
|\ \ | |/ |/| Remove unnecessary string formats
| * Remove unnecessary string formatsKe Li2016-11-222-6/+8
| | | | | | | | Signed-off-by: Ke Li <kel@splunk.com>
* | Internal interface to differentiate built-in drivers from remoteMadhu Venugopal2016-12-191-0/+4
| | | | | | | | Signed-off-by: Madhu Venugopal <madhu@docker.com>
* | Handle the case of registering active plugins during remote initMadhu Venugopal2016-12-161-7/+14
|/ | | | | | | | | With Plugin-V2, plugins can get activated before remote driver is Initialized. Those plugins fails to get registered with drvRegistry. This fix handles that scenario Signed-off-by: Madhu Venugopal <madhu@docker.com>
* Refactoring logrus import and formattingDaehyeok Mun2016-11-081-3/+3
| | | | | | | | | | This fix tries to fix logrus formatting by removing `f` from `logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string is not present. Also fix import name to use original project name 'logrus' instead of 'log' Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
* Add support for NetworkAllocate and NetworkFree in remote driverMadhu Venugopal2016-10-052-3/+44
| | | | | | Also added an API to return list of builtin network drivers Signed-off-by: Madhu Venugopal <madhu@docker.com>
* Make libnetwork understand pluginv2.Anusha Ragunathan2016-09-271-1/+6
| | | | | | | | | | As part of daemon init, network and ipam drivers are passed a pluginstore object that implements the plugin/getter interface. Use this interface methods in libnetwork to interact with network plugins. This interface provides the new and improved pluginv2 functionality and falls back to pluginv1 (legacy) if necessary. Signed-off-by: Anusha Ragunathan <anusha@docker.com>
* Move engine-api to docker/docker/apiJana Radhakrishnan2016-09-071-7/+7
| | | | | | Remove all dependencies to engine-api and start using docker/docker/api. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
* Merge pull request #1205 from allencloud/fix-typosJana Radhakrishnan2016-08-011-1/+1
|\ | | | | use grep to find a/an misuse
| * use grep to find a/an misuseallencloud2016-06-031-1/+1
| | | | | | | | Signed-off-by: allencloud <allen.sun@daocloud.io>
* | Do not error on non discovery type messages in remote driverAlessandro Boch2016-06-251-2/+2
|/ | | | Signed-off-by: Alessandro Boch <aboch@docker.com>
* Add driver api enhancements for gossipJana Radhakrishnan2016-04-182-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add overlay manager driverJana Radhakrishnan2016-04-141-1/+1
| | | | | | | | | | | | | Because overlay is a builtin driver and global allocation of overlay resources is probably going to happen in a different node (a single node) and the actual plumbing of the network is probably going to happen in all nodes, it makes sense to split the functionality of allocation into two different packages. The central component(this package) only implements the NetworkAllocate/Free apis while the distributed component(the existing overlay driver) implements the rest of the driver api. This way we can reduce the memory footprint overall. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
* Add NetworkAllocate/Free to driver apiJana Radhakrishnan2016-04-111-0/+8
| | | | | | | | | Added NetworkAllocate and NetworkFree apis to the list of driver apis. The intention of the api is to provide a centralized way of allocating and freeing network resources for a network which is cross-host. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
* Use newly introduce plugins method to validate plugin responseAlessandro Boch2016-04-081-7/+2
| | | | | | | - for endpoints which are not expected to be implemented by all remote drivers. Signed-off-by: Alessandro Boch <aboch@docker.com>
* Merge pull request #810 from aboch/seSanthosh Manohar2016-03-062-0/+57
|\ | | | | Move exposed ports and port bindings from Endpoint to Sandbox
| * Move exposed ports from Endpoint to SandboxAlessandro Boch2016-03-062-0/+57
| | | | | | | | Signed-off-by: Alessandro Boch <aboch@docker.com>
* | Merge pull request #803 from aboch/pmMadhu Venugopal2016-03-031-3/+14
|\ \ | |/ |/| Libnetwork to program container interface's MAC
| * Libnetwork to set container interface's MACAlessandro Boch2015-12-041-3/+14
| | | | | | | | | | | | | | | | - Consistently with what it does for IP addresses, libnetwork will also program the container interface's MAC address with the value set by network driver in InterfaceInfo. Signed-off-by: Alessandro Boch <aboch@docker.com>
* | Introduce discoverapi.Discover interfaceAlessandro Boch2016-01-283-8/+11
| | | | | | | | | | | | | | | | - Move DiscoverNew() and DiscoverDelete() methods into the new interface - Add DatastoreUpdate notification - Now this interface can be implemented by any drivers, not only network drivers Signed-off-by: Alessandro Boch <aboch@docker.com>
* | Fix up Godeps and update docker/docker packagesJana Radhakrishnan2015-12-231-1/+2
|/ | | | Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
* Add DisableGatewayService in JoinInfo to offering drivers the ability to ↵Chun Chen2015-12-033-18/+27
| | | | | | disable default gateway Signed-off-by: Chun Chen <ramichen@tencent.com>
* libnetwork <-> ipam driver interactionAlessandro Boch2015-10-033-81/+108
| | | | Signed-off-by: Alessandro Boch <aboch@docker.com>
* Integration with Docker DiscoveryMadhu Venugopal2015-10-013-1/+56
| | | | | | | | | | | | * integrated hostdiscovery package with the new Docker Discovery * Integrated hostdiscovery package with libnetwork core * removed libnetwork_discovery tag * Introduced driver apis for discovery events * moved overlay driver to make use of the discovery events * Using Docker Discovery service. * Changed integration-tests to make use of the new discovery Signed-off-by: Madhu Venugopal <madhu@docker.com>
* Godeps updateMadhu Venugopal2015-09-301-8/+13
| | | | Signed-off-by: Madhu Venugopal <madhu@docker.com>
* Various refactor and fixes for the previous two commits including:Chun Chen2015-09-221-4/+5
| | | | | | | | | | 1. Don't save localscope endpoints to localstore for now. 2. Add common function updateToStore/deleteFromStore to store KVObjects. 3. Merge `getNetworksFromGlobalStore` and `getNetworksFromLocalStore` 4. Add `n.isGlobalScoped` before `n.watchEndpoints` in `addNetwork` 5. Fix integration-tests 6. Fix test failure in drivers/remote/driver_test.go 7. Restore network to store if deleteNework failed
* Add local datastore to persist states of LocalScope networkChun Chen2015-09-211-2/+3
| | | | Signed-off-by: Chun Chen <ramichen@tencent.com>
* Merge pull request #547 from mrjana/configMadhu Venugopal2015-09-191-1/+1
|\ | | | | Push driver config during `Init`
| * Push driver config during `Init`Jana Radhakrishnan2015-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Introduce test remote plugin in dnetJana Radhakrishnan2015-09-171-2/+2
|/ | | | | | | | | | | | | | | | | There are multiple goals of introducing test driver plugin - Need a driver which can be configured to simulate different driver behaviors - For pure libnetwork multi-host integration testing a test driver configured for global scope can be used without trying to use a real driver like overlay which comes with it's own dependencies which can't be satisfied all enviroments(I am looking at you circleci) This PR also makes all test cases that we have so far to be run in circleci without any skipping needed. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
* Add negotiation process for driver scopeZhang Wei2015-09-153-12/+139
| | | | | | | Add one capability negotiation interaction after plugin handshake, use this to determine plugin's capability instead of default "global" scope. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
* Remove multiple interface in an endpointJana Radhakrishnan2015-09-113-84/+57
| | | | | | | | | 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>
* Move test specific functions to a testutils package.David Calavera2015-09-071-1/+1
| | | | | | | | | 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>
* Introduce Sandbox entityAlessandro Boch2015-08-273-46/+24
| | | | | | | | | | | | | | | | - 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>
* Expose the remote driver API structs publicly.Erik Hollensbe2015-07-163-197/+229
|
* Replacing isReservedNetwork with Driver capabilityMadhu Venugopal2015-06-101-1/+4
| | | | | | | | | | | | | Currently store makes use of a static isReservedNetwork check to decide if a network needs to be stored in the distributed store or not. But it is better if the check is not static, but be determined based on the capability of the driver that backs the network. Hence introducing a new capability mechanism to the driver which it can express its capability during registration. Making use of first such capability : Scope. This can be expanded in the future for more such cases. Signed-off-by: Madhu Venugopal <madhu@docker.com>
* Merge pull request #240 from Metaswitch/remote-driver-static-routesaboch2015-06-033-5/+85
|\ | | | | Add static routes to the remote driver.