Ensure members are added to the pool upon svc updates
As kuryr is creating a new listener/pool for each port exposed
on the service, regardless of the target port being the same, this
patch ensures the members are added for all the pools, not only
in the first one created for a given target port
Closes-Bug: 1812047
(cherry picked from commit a8951134ed
)
Change-Id: I3aee1b546d1cd458a69fd61180f8fd4c7440d995
This commit is contained in:
parent
ed79e09c38
commit
06e88c9099
|
@ -342,7 +342,8 @@ class LoadBalancerHandler(k8s_base.ResourceEventHandler):
|
|||
p.port]
|
||||
except KeyError:
|
||||
continue
|
||||
current_targets = {(str(m.ip), m.port) for m in lbaas_state.members}
|
||||
current_targets = {(str(m.ip), m.port, m.pool_id)
|
||||
for m in lbaas_state.members}
|
||||
|
||||
for subset in endpoints.get('subsets', []):
|
||||
subset_ports = subset.get('ports', [])
|
||||
|
@ -358,10 +359,10 @@ class LoadBalancerHandler(k8s_base.ResourceEventHandler):
|
|||
continue
|
||||
for subset_port in subset_ports:
|
||||
target_port = subset_port['port']
|
||||
if (target_ip, target_port) in current_targets:
|
||||
continue
|
||||
port_name = subset_port.get('name')
|
||||
pool = pool_by_tgt_name[port_name]
|
||||
if (target_ip, target_port, pool.id) in current_targets:
|
||||
continue
|
||||
# TODO(apuimedo): Do not pass subnet_id at all when in
|
||||
# L3 mode once old neutron-lbaasv2 is not supported, as
|
||||
# octavia does not require it
|
||||
|
|
Loading…
Reference in New Issue