summaryrefslogtreecommitdiff
path: root/libnetwork/ipamapi
Commit message (Collapse)AuthorAgeFilesLines
* libnetwork: drop DatastoreConfig discovery typeCory Snider2023-01-271-3/+0
| | | | | | | | | | | | | | | The DatastoreConfig discovery type is unused. Remove the constant and any resulting dead code. Today's biggest loser is the IPAM Allocator: DatastoreConfig was the only type of discovery event it was listening for, and there was no other place where a non-nil datastore could be passed into the allocator. Strip out all the dead persistence code from Allocator, leaving it as purely an in-memory implementation. There is no more need to check the consistency of the allocator's bit-sequences as there is no persistent storage for inconsistent bit sequences to be loaded from. Signed-off-by: Cory Snider <csnider@mirantis.com>
* libnet: un-plumb datastores from IPAM initsCory Snider2023-01-271-5/+12
| | | | | | | | | | | | | | | | | | | | | The datastore arguments to the IPAM driver Init() functions are always nil, even in Swarmkit. The only IPAM driver which consumed the datastores was builtin; all others (null, remote, windowsipam) simply ignored it. As the signatures of the IPAM driver init functions cannot be changed without breaking the Swarmkit build, they have to be left with the same signatures for the time being. Assert that nil datastores are always passed into the builtin IPAM driver's init function so that there is no ambiguity the datastores are no longer respected. Add new Register functions for the IPAM drivers which are free from the legacy baggage of the Init functions. (The legacy Init functions can be removed once Swarmkit is migrated to using the Register functions.) As the remote IPAM driver is the only one which depends on a PluginGetter, pass it in explicitly as an argument to Register. The other IPAM drivers should not be forced to depend on a GetPluginGetter() method they do not use (Interface Segregation Principle). Signed-off-by: Cory Snider <csnider@mirantis.com>
* libnetwork/ipamapi: godoc fixesSebastiaan van Stijn2021-08-271-15/+4
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Fixup libnetwork lint errorsBrian Goff2021-06-011-1/+1
| | | | Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Fix libnetwork importsBrian Goff2021-06-011-2/+2
| | | | | | | | | 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>
* Adding a unit case to verify rolloverAbhinandan Prativadi2017-10-031-0/+10
| | | | Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
* Internal interface to differentiate built-in drivers from remoteMadhu Venugopal2016-12-191-0/+3
| | | | Signed-off-by: Madhu Venugopal <madhu@docker.com>
* Update plugingetter import path.Anusha Ragunathan2016-10-071-2/+2
| | | | Signed-off-by: Anusha Ragunathan <anusha@docker.com>
* Make libnetwork understand pluginv2.Anusha Ragunathan2016-09-271-0/+3
| | | | | | | | | | 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>
* 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>
* | Fix crash when remote plugin returns empty address stringThomas Graf2016-07-291-0/+1
| | | | | | | | | | | | | | | | | | | | If a remote plugin returns an empty string in response to RequestAddress(), the internal helper will return nil which will crash libnetwork in several places. Treat an empty string as a new error ipamapi.ErrNoIPReturned. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* | Avoid persisting ipam data if it can be reconstructedAlessandro Boch2016-05-121-0/+5
|/ | | | | | | - Also restore older behavior where overlap check is not run when preferred pool is specified. Got broken by recent changes Signed-off-by: Alessandro Boch <aboch@docker.com>
* Add nil ipam driverAlessandro Boch2016-03-021-0/+2
| | | | | Signed-off-by: Alessandro Boch <aboch@docker.com> Signed-off-by: Chun Chen <ramichen@tencent.com>
* Fix some typos.allencloud2016-02-291-1/+1
| | | | Signed-off-by: allencloud <allen.sun@daocloud.io>
* Handle datastore update in Ipam and overlay driversAlessandro Boch2016-02-161-0/+3
| | | | Signed-off-by: Alessandro Boch <aboch@docker.com>
* Stop referring to requested IP address as "preferred",Bryan Boreham2016-01-261-1/+1
| | | | | | since it is an error if that address is unavailable. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
* Allow remote IPAM driver to express capabilityAlessandro Boch2015-12-171-1/+8
| | | | | | | | | - So that a DHCP based plugin can express it needs the endpoint MAC address when requested for an IP address. - In such case libnetwork will allocate one if not already provided by user Signed-off-by: Alessandro Boch <aboch@docker.com>
* When assigning an address for an endpoint set preferred address andRyan Belgrave2015-12-041-0/+2
| | | | | | | | options. When requesting a gateway address send a gateway label in the options. Signed-off-by: Ryan Belgrave <rmb1993@gmail.com>
* Adjust ipam errorsAlessandro Boch2015-12-021-17/+15
| | | | | | | | | | | | | | | | - Remove from contract predefined errors which are no longer valid (ex. ErrInvalidIpamService, ErrInvalidIpamConfigService) - Do not use network driver error for ipam load failure in controller.go - Bitseq to expose two well-known errors (no more bit available, bit is already set) - Default ipam to report proper well-known error on RequestAddress() based on bitseq returned error - Default ipam errors to comply with types error interface Signed-off-by: Alessandro Boch <aboch@docker.com>
* IPAM driver docAlessandro Boch2015-10-121-2/+2
| | | | Signed-off-by: Alessandro Boch <aboch@docker.com>
* libnetwork <-> ipam driver interactionAlessandro Boch2015-10-031-2/+0
| | | | Signed-off-by: Alessandro Boch <aboch@docker.com>
* IPAM driverAlessandro Boch2015-10-031-0/+74
- Add IPAM cotract and remote IPAM hooks - Add ipam registration in controller - Have default IPAM follow ipamapi contract Signed-off-by: Alessandro Boch <aboch@docker.com>