Browse Source

Merge "Add IPv6 support to namespace subnet driver"

changes/76/713776/1
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
b7aab69c8f
  1. 3
      kuryr_kubernetes/controller/drivers/namespace_subnet.py
  2. 11
      kuryr_kubernetes/utils.py

3
kuryr_kubernetes/controller/drivers/namespace_subnet.py

@ -181,10 +181,11 @@ class NamespacePodSubnetDriver(default_subnet.DefaultPodSubnetDriver):
# create subnet with namespace as name
subnet_pool_id = oslo_cfg.CONF.namespace_subnet.pod_subnet_pool
ip_version = utils.get_subnetpool_version(subnet_pool_id)
try:
neutron_subnet = (os_net
.create_subnet(network_id=net_id,
ip_version=4,
ip_version=ip_version,
name=subnet_name,
enable_dhcp=False,
subnetpool_id=subnet_pool_id,

11
kuryr_kubernetes/utils.py

@ -201,6 +201,17 @@ def get_subnet_cidr(subnet_id):
return subnet_obj.cidr
@MEMOIZE
def get_subnetpool_version(subnetpool_id):
os_net = clients.get_network_client()
try:
subnetpool_obj = os_net.get_subnet_pool(subnetpool_id)
except os_exc.ResourceNotFound:
LOG.exception("Subnetpool %s not found!", subnetpool_id)
raise
return subnetpool_obj.ip_version
def extract_pod_annotation(annotation):
obj = objects.base.VersionedObject.obj_from_primitive(annotation)
# FIXME(dulek): This is code to maintain compatibility with Queens. We can

Loading…
Cancel
Save