- The pool request code does not behave properly in
case of concurrent requests when client does not
specify a preferred pool. It may dispense the same
predefined pool to different networks.
- The issue is common for local and global
address spaces
Signed-off-by: Alessandro Boch <aboch@docker.com>
- Test random de-allocation of allocated addresses
which is closer to real use case
- Test db reconstruction after read from datastore
Signed-off-by: Alessandro Boch <aboch@docker.com>
- 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>
- Currently allocator pulls all the bitmasks from datastore
before processing each public API. This is not needed as
the APIs already selectively pull the interested bitmask
when needed.
Signed-off-by: Alessandro Boch <aboch@docker.com>
Added a check to see if address space is valid in
addrSpaces map before accessing it. Also fixed some
error strings so that it provides better information
to the user.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
- 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>
- libnetwork should reserve only the auxiliary
addresses which belong to the container
addresable pool. And should fail the network
creation if the aux addr does not belong to
the master pool.
Signed-off-by: Alessandro Boch <aboch@docker.com>
Remove the need for watching for IPAM data
structures and add multi store support code and
data reorganization to simplify address space
management.
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Currently the default ipam implementation ignores the prefered ip if the
request is made on an existing sub-pool. The priority should be other
way around.
Signed-off-by: Madhu Venugopal <madhu@docker.com>
- also provided a new utility to compute the
host part ip address which is resilient to
input passed in different representations.
Signed-off-by: Alessandro Boch <aboch@docker.com>
In that commit, AtomicPutCreate takes previous = nil to Atomically create keys
that don't exist. We need a create operation that is atomic to prevent races
between multiple libnetworks creating the same object.
Previously, we just created new KVs with an index of 0 and wrote them to the
datastore. Consul accepts this behaviour and interprets index of 0 as
non-existing, but other data backends do no.
- Add Exists() to the KV interface. SetIndex() should also modify a KV so
that it exists.
- Call SetIndex() from within the GetObject() method on DataStore interface.
- This ensures objects have the updated values for exists and index.
- Add SetValue() to the KV interface. This allows implementers to define
their own method to marshall and unmarshall (as bitseq and allocator have).
- Update existing users of the DataStore (endpoint, network, bitseq,
allocator, ov_network) to new interfaces.
- Fix UTs.
- At Handle creation, first check if an instance of the
the respective object is already present in the datastore.
- Handle sequence must be saved only if commit
to datastore is succesfull
- Caller (ipam) needs to manage the retry
Signed-off-by: Alessandro Boch <aboch@docker.com>
- Handle contains sequence and identifier.
This way datastore integration can be done
at bitseq level.
Signed-off-by: Alessandro Boch <aboch@docker.com>
- In order to facilitate usage of datastore
- This makes it slower. Efficiency will be
revisited later after datastore integration
is done.
Signed-off-by: Alessandro Boch <aboch@docker.com>