From 519ea1ef509da3b9877470b68bd3f0a8def24c8f Mon Sep 17 00:00:00 2001 From: Pzhang Date: Mon, 20 Nov 2023 07:35:19 +0000 Subject: [PATCH] OPENSTACK-2925: add some comments for agent member code --- .../lbaasv2/drivers/bigip/resource_manager.py | 3 ++- f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/f5_openstack_agent/lbaasv2/drivers/bigip/resource_manager.py b/f5_openstack_agent/lbaasv2/drivers/bigip/resource_manager.py index 8bf2aa537..08155fe58 100644 --- a/f5_openstack_agent/lbaasv2/drivers/bigip/resource_manager.py +++ b/f5_openstack_agent/lbaasv2/drivers/bigip/resource_manager.py @@ -2007,8 +2007,9 @@ def _create_member_payload(self, loadbalancer, member): def _create_payload(self, member, service): return self.driver.service_adapter.get_member(service) + # NOTE(x) based on the existed bigip members, we add or remove delta value + # of bulk changed members. def _merge_members(self, lbaas_members, bigip_members, delete=False): - # why use merge ? perhaps to in case of existed member status change? ret = {} diff --git a/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py b/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py index 05cff2686..08d803e80 100644 --- a/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py +++ b/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py @@ -368,6 +368,12 @@ def get_monitor_type(self, service): monitor_type = lbaas_healthmonitor["type"] return monitor_type + # NOTE(x): in ng, the lbaas_members argument is all the members of the + # current updating pool for create and delete. + # however, in bulk create (bulk delete use another way to construct + # members) the lbaas_members argument is the delta + # value of changed members. Since bulk create will merge members + # from bigips, the merged result is total members of the pool for updating. def _map_pool(self, loadbalancer, lbaas_pool, lbaas_hm, lbaas_members): pool = self.init_pool_name(loadbalancer, lbaas_pool) pool["description"] = " "