Merge "Fix listener update when using SRIOV VIP" into stable/2024.1

This commit is contained in:
Zuul 2024-06-05 17:36:18 +00:00 committed by Gerrit Code Review
commit ab7712ede5
3 changed files with 31 additions and 20 deletions

View File

@ -161,7 +161,7 @@ class ListenerFlows(object):
return update_listener_flow
def _get_firewall_rules_subflow(self, flavor_dict):
def _get_firewall_rules_subflow(self, flavor_dict, timeout_dict=None):
"""Creates a subflow that updates the firewall rules in the amphorae.
:returns: The subflow for updating firewall rules in the amphorae.
@ -174,6 +174,14 @@ class ListenerFlows(object):
requires=constants.LOADBALANCER_ID,
provides=constants.AMPHORAE))
fw_rules_subflow.add(
amphora_driver_tasks.AmphoraeGetConnectivityStatus(
name=constants.AMPHORAE_GET_CONNECTIVITY_STATUS,
requires=constants.AMPHORAE,
inject={constants.TIMEOUT_DICT: timeout_dict,
constants.NEW_AMPHORA_ID: constants.NIL_UUID},
provides=constants.AMPHORAE_STATUS))
fw_rules_subflow.add(network_tasks.GetAmphoraeNetworkConfigs(
name=sf_name + '-' + constants.GET_AMP_NETWORK_CONFIG,
requires=constants.LOADBALANCER_ID,
@ -192,8 +200,10 @@ class ListenerFlows(object):
amp_0_subflow.add(amphora_driver_tasks.SetAmphoraFirewallRules(
name=sf_name + '-0-' + constants.SET_AMPHORA_FIREWALL_RULES,
requires=(constants.AMPHORAE, constants.AMPHORA_FIREWALL_RULES),
inject={constants.AMPHORA_INDEX: 0}))
requires=(constants.AMPHORAE, constants.AMPHORA_FIREWALL_RULES,
constants.AMPHORAE_STATUS),
inject={constants.AMPHORA_INDEX: 0,
constants.TIMEOUT_DICT: timeout_dict}))
update_amps_subflow.add(amp_0_subflow)
@ -212,8 +222,10 @@ class ListenerFlows(object):
amp_1_subflow.add(amphora_driver_tasks.SetAmphoraFirewallRules(
name=sf_name + '-1-' + constants.SET_AMPHORA_FIREWALL_RULES,
requires=(constants.AMPHORAE,
constants.AMPHORA_FIREWALL_RULES),
inject={constants.AMPHORA_INDEX: 1}))
constants.AMPHORA_FIREWALL_RULES,
constants.AMPHORAE_STATUS),
inject={constants.AMPHORA_INDEX: 1,
constants.TIMEOUT_DICT: timeout_dict}))
update_amps_subflow.add(amp_1_subflow)

View File

@ -44,15 +44,14 @@ class TestListenerFlows(base.TestCase):
self.assertIn(constants.LISTENERS, listener_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
listener_flow.provides)
self.assertIn(constants.AMPHORAE, listener_flow.provides)
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
self.assertEqual(3, len(listener_flow.requires))
self.assertEqual(3, len(listener_flow.provides))
self.assertEqual(2, len(listener_flow.requires))
self.assertEqual(4, len(listener_flow.provides))
def test_get_delete_listener_flow(self, mock_get_net_driver):
flavor_dict = {
@ -66,15 +65,14 @@ class TestListenerFlows(base.TestCase):
self.assertIn(constants.LISTENER, listener_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
self.assertIn(constants.PROJECT_ID, listener_flow.requires)
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
listener_flow.provides)
self.assertIn(constants.AMPHORAE, listener_flow.provides)
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
self.assertEqual(4, len(listener_flow.requires))
self.assertEqual(3, len(listener_flow.provides))
self.assertEqual(3, len(listener_flow.requires))
self.assertEqual(4, len(listener_flow.provides))
def test_get_delete_listener_internal_flow(self, mock_get_net_driver):
flavor_dict = {
@ -88,15 +86,14 @@ class TestListenerFlows(base.TestCase):
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
self.assertIn(constants.PROJECT_ID, listener_flow.requires)
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
listener_flow.provides)
self.assertIn(constants.AMPHORAE, listener_flow.provides)
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
self.assertEqual(3, len(listener_flow.requires))
self.assertEqual(3, len(listener_flow.provides))
self.assertEqual(2, len(listener_flow.requires))
self.assertEqual(4, len(listener_flow.provides))
def test_get_update_listener_flow(self, mock_get_net_driver):
flavor_dict = {
@ -112,15 +109,14 @@ class TestListenerFlows(base.TestCase):
self.assertIn(constants.UPDATE_DICT, listener_flow.requires)
self.assertIn(constants.LISTENERS, listener_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
listener_flow.provides)
self.assertIn(constants.AMPHORAE, listener_flow.provides)
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
self.assertEqual(5, len(listener_flow.requires))
self.assertEqual(3, len(listener_flow.provides))
self.assertEqual(4, len(listener_flow.requires))
self.assertEqual(4, len(listener_flow.provides))
def test_get_create_all_listeners_flow(self, mock_get_net_driver):
flavor_dict = {
@ -131,12 +127,11 @@ class TestListenerFlows(base.TestCase):
self.assertIsInstance(listeners_flow, flow.Flow)
self.assertIn(constants.LOADBALANCER, listeners_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, listeners_flow.requires)
self.assertIn(constants.AMPHORAE_STATUS, listeners_flow.requires)
self.assertIn(constants.LOADBALANCER, listeners_flow.provides)
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
listeners_flow.provides)
self.assertIn(constants.AMPHORAE, listeners_flow.provides)
self.assertIn(constants.AMPHORA_FIREWALL_RULES,
listeners_flow.provides)
self.assertEqual(3, len(listeners_flow.requires))
self.assertEqual(5, len(listeners_flow.provides))
self.assertEqual(2, len(listeners_flow.requires))
self.assertEqual(6, len(listeners_flow.provides))

View File

@ -0,0 +1,4 @@
---
fixes:
- |
Fixed an issue updating listeners when using SR-IOV VIP ports.