Remove allocation_pools in the subnet request against Neutron

This patch removes the allocation_pools from the request for the subnet
creation, which is not supposed to contain that field for allocating all
IP addresses. allocation_pools with null leads the validation error and
this causes the failures of the endpoint creation.

Change-Id: I3ef43ed32a65cc885303530a0292d0c9a84a6d78
Signed-off-by: Taku Fukushima <f.tac.mac@gmail.com>
Closes-Bug: #1503183
This commit is contained in:
Taku Fukushima 2015-10-06 17:58:33 +09:00 committed by Antoni Segura Puimedon
parent 043c608757
commit ea02211402
4 changed files with 6 additions and 6 deletions

View File

@ -118,6 +118,11 @@ Libnetwork User Workflow (with Kuryr as remove driver) - Host Networking
4) Kuryr creates a port assigning the IP address to it and associating the port with
the subnet based on it's already allocated in 2.
On the subnet creation described in (2) and (3) above, Kuryr tries to grab
the allocation pool greedily by not specifying ``allocation_pool``. Without
``allocation_pool``, Neutron allocates all IP addresses in the range of the
subnet CIDR as described in `Neutron's API reference`_.
When the Neutron port has been created, the Kuryr remote driver will generate a response to the
docker daemon indicating the port's IPv4, IPv6, and Mac addresses as follows.
::
@ -268,3 +273,4 @@ automatically.
.. _APIs: https://github.com/docker/libnetwork/blob/master/docs/design.md#api
.. _libkv: https://github.com/docker/libkv
.. _IPAM blueprint: https://blueprints.launchpad.net/kuryr/+spec/ipam
.. _Neutron's API reference: http://developer.openstack.org/api-ref-networking-v2.html#createSubnet

View File

@ -100,8 +100,6 @@ def _process_subnet(neutron_network_id, endpoint_id, interface_cidr,
else:
new_subnets.append({
'name': '-'.join([endpoint_id, subnet_network]),
# Allocate all IP addresses in the subnet.
'allocation_pools': None,
'network_id': neutron_network_id,
'ip_version': cidr.version,
'cidr': subnet_cidr,

View File

@ -137,14 +137,12 @@ class TestKuryr(base.TestKuryrBase):
'name': '-'.join([docker_endpoint_id,
'192.168.1.0']),
'network_id': fake_neutron_network_id,
'allocation_pools': None,
'ip_version': 4,
"cidr": '192.168.1.0/24'
}, {
'name': '-'.join([docker_endpoint_id,
'fe80::']),
'network_id': fake_neutron_network_id,
'allocation_pools': None,
'ip_version': 6,
"cidr": 'fe80::/64'
}]

View File

@ -38,13 +38,11 @@ class TestKuryrEndpointFailures(base.TestKuryrFailures):
'subnets': [{
'name': '-'.join([docker_endpoint_id, '192.168.1.0']),
'network_id': neutron_network_id,
'allocation_pools': None,
'ip_version': 4,
"cidr": '192.168.1.0/24'
}, {
'name': '-'.join([docker_endpoint_id, 'fe80::']),
'network_id': neutron_network_id,
'allocation_pools': None,
'ip_version': 6,
"cidr": 'fe80::/64'
}]