Browse Source

Delete ports without device_owner on ns deletion

Neutron clears device_owner when port is detached. This means that with
pools we need to consider ports without device_owner set when doing
cleanup on namespace deletion.

Change-Id: Ic38015cba27d8418175027ec4e433df32eae4706
changes/69/749769/1
Michał Dulko 11 months ago
parent
commit
41c00f6584
  1. 4
      kuryr_kubernetes/controller/drivers/namespace_subnet.py

4
kuryr_kubernetes/controller/drivers/namespace_subnet.py

@ -106,7 +106,9 @@ class NamespacePodSubnetDriver(default_subnet.DefaultPodSubnetDriver):
"Deleting leftovers ports before retrying", net_id)
leftover_ports = os_net.ports(network_id=net_id)
for leftover_port in leftover_ports:
if leftover_port.device_owner not in ['trunk:subport',
# NOTE(dulek): '' is there because Neutron seems to unset
# device_owner on detach.
if leftover_port.device_owner not in ['', 'trunk:subport',
kl_const.DEVICE_OWNER]:
continue
try:

Loading…
Cancel
Save