Skip to content

Commit c704267

Browse files
Michael Johnsonjohnsom
authored andcommitted
Fix listener update when using SRIOV VIP
The previous patch[1] that added a check for Amphora status missed adding a task that generates the Amphora status information when a listener is updated. This patch corrects that by adding the AmphoraeGetConnectivityStatus task to the firewall rules subflow. [1] https://review.opendev.org/c/openstack/octavia/+/912599 Change-Id: I325de85b03080db646da847b58c15c3fbbdc6be2 (cherry picked from commit 70f15c5)
1 parent b370e46 commit c704267

File tree

3 files changed

+31
-20
lines changed

3 files changed

+31
-20
lines changed

octavia/controller/worker/v2/flows/listener_flows.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def get_update_listener_flow(self, flavor_dict=None):
161161

162162
return update_listener_flow
163163

164-
def _get_firewall_rules_subflow(self, flavor_dict):
164+
def _get_firewall_rules_subflow(self, flavor_dict, timeout_dict=None):
165165
"""Creates a subflow that updates the firewall rules in the amphorae.
166166
167167
:returns: The subflow for updating firewall rules in the amphorae.
@@ -174,6 +174,14 @@ def _get_firewall_rules_subflow(self, flavor_dict):
174174
requires=constants.LOADBALANCER_ID,
175175
provides=constants.AMPHORAE))
176176

177+
fw_rules_subflow.add(
178+
amphora_driver_tasks.AmphoraeGetConnectivityStatus(
179+
name=constants.AMPHORAE_GET_CONNECTIVITY_STATUS,
180+
requires=constants.AMPHORAE,
181+
inject={constants.TIMEOUT_DICT: timeout_dict,
182+
constants.NEW_AMPHORA_ID: constants.NIL_UUID},
183+
provides=constants.AMPHORAE_STATUS))
184+
177185
fw_rules_subflow.add(network_tasks.GetAmphoraeNetworkConfigs(
178186
name=sf_name + '-' + constants.GET_AMP_NETWORK_CONFIG,
179187
requires=constants.LOADBALANCER_ID,
@@ -192,8 +200,10 @@ def _get_firewall_rules_subflow(self, flavor_dict):
192200

193201
amp_0_subflow.add(amphora_driver_tasks.SetAmphoraFirewallRules(
194202
name=sf_name + '-0-' + constants.SET_AMPHORA_FIREWALL_RULES,
195-
requires=(constants.AMPHORAE, constants.AMPHORA_FIREWALL_RULES),
196-
inject={constants.AMPHORA_INDEX: 0}))
203+
requires=(constants.AMPHORAE, constants.AMPHORA_FIREWALL_RULES,
204+
constants.AMPHORAE_STATUS),
205+
inject={constants.AMPHORA_INDEX: 0,
206+
constants.TIMEOUT_DICT: timeout_dict}))
197207

198208
update_amps_subflow.add(amp_0_subflow)
199209

@@ -212,8 +222,10 @@ def _get_firewall_rules_subflow(self, flavor_dict):
212222
amp_1_subflow.add(amphora_driver_tasks.SetAmphoraFirewallRules(
213223
name=sf_name + '-1-' + constants.SET_AMPHORA_FIREWALL_RULES,
214224
requires=(constants.AMPHORAE,
215-
constants.AMPHORA_FIREWALL_RULES),
216-
inject={constants.AMPHORA_INDEX: 1}))
225+
constants.AMPHORA_FIREWALL_RULES,
226+
constants.AMPHORAE_STATUS),
227+
inject={constants.AMPHORA_INDEX: 1,
228+
constants.TIMEOUT_DICT: timeout_dict}))
217229

218230
update_amps_subflow.add(amp_1_subflow)
219231

octavia/tests/unit/controller/worker/v2/flows/test_listener_flows.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ def test_get_create_listener_flow(self, mock_get_net_driver):
4444

4545
self.assertIn(constants.LISTENERS, listener_flow.requires)
4646
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
47-
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
4847

4948
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
5049
listener_flow.provides)
5150
self.assertIn(constants.AMPHORAE, listener_flow.provides)
5251
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
5352

54-
self.assertEqual(3, len(listener_flow.requires))
55-
self.assertEqual(3, len(listener_flow.provides))
53+
self.assertEqual(2, len(listener_flow.requires))
54+
self.assertEqual(4, len(listener_flow.provides))
5655

5756
def test_get_delete_listener_flow(self, mock_get_net_driver):
5857
flavor_dict = {
@@ -66,15 +65,14 @@ def test_get_delete_listener_flow(self, mock_get_net_driver):
6665
self.assertIn(constants.LISTENER, listener_flow.requires)
6766
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
6867
self.assertIn(constants.PROJECT_ID, listener_flow.requires)
69-
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
7068

7169
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
7270
listener_flow.provides)
7371
self.assertIn(constants.AMPHORAE, listener_flow.provides)
7472
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
7573

76-
self.assertEqual(4, len(listener_flow.requires))
77-
self.assertEqual(3, len(listener_flow.provides))
74+
self.assertEqual(3, len(listener_flow.requires))
75+
self.assertEqual(4, len(listener_flow.provides))
7876

7977
def test_get_delete_listener_internal_flow(self, mock_get_net_driver):
8078
flavor_dict = {
@@ -88,15 +86,14 @@ def test_get_delete_listener_internal_flow(self, mock_get_net_driver):
8886

8987
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
9088
self.assertIn(constants.PROJECT_ID, listener_flow.requires)
91-
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
9289

9390
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
9491
listener_flow.provides)
9592
self.assertIn(constants.AMPHORAE, listener_flow.provides)
9693
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
9794

98-
self.assertEqual(3, len(listener_flow.requires))
99-
self.assertEqual(3, len(listener_flow.provides))
95+
self.assertEqual(2, len(listener_flow.requires))
96+
self.assertEqual(4, len(listener_flow.provides))
10097

10198
def test_get_update_listener_flow(self, mock_get_net_driver):
10299
flavor_dict = {
@@ -112,15 +109,14 @@ def test_get_update_listener_flow(self, mock_get_net_driver):
112109
self.assertIn(constants.UPDATE_DICT, listener_flow.requires)
113110
self.assertIn(constants.LISTENERS, listener_flow.requires)
114111
self.assertIn(constants.LOADBALANCER_ID, listener_flow.requires)
115-
self.assertIn(constants.AMPHORAE_STATUS, listener_flow.requires)
116112

117113
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
118114
listener_flow.provides)
119115
self.assertIn(constants.AMPHORAE, listener_flow.provides)
120116
self.assertIn(constants.AMPHORA_FIREWALL_RULES, listener_flow.provides)
121117

122-
self.assertEqual(5, len(listener_flow.requires))
123-
self.assertEqual(3, len(listener_flow.provides))
118+
self.assertEqual(4, len(listener_flow.requires))
119+
self.assertEqual(4, len(listener_flow.provides))
124120

125121
def test_get_create_all_listeners_flow(self, mock_get_net_driver):
126122
flavor_dict = {
@@ -131,12 +127,11 @@ def test_get_create_all_listeners_flow(self, mock_get_net_driver):
131127
self.assertIsInstance(listeners_flow, flow.Flow)
132128
self.assertIn(constants.LOADBALANCER, listeners_flow.requires)
133129
self.assertIn(constants.LOADBALANCER_ID, listeners_flow.requires)
134-
self.assertIn(constants.AMPHORAE_STATUS, listeners_flow.requires)
135130
self.assertIn(constants.LOADBALANCER, listeners_flow.provides)
136131
self.assertIn(constants.AMPHORAE_NETWORK_CONFIG,
137132
listeners_flow.provides)
138133
self.assertIn(constants.AMPHORAE, listeners_flow.provides)
139134
self.assertIn(constants.AMPHORA_FIREWALL_RULES,
140135
listeners_flow.provides)
141-
self.assertEqual(3, len(listeners_flow.requires))
142-
self.assertEqual(5, len(listeners_flow.provides))
136+
self.assertEqual(2, len(listeners_flow.requires))
137+
self.assertEqual(6, len(listeners_flow.provides))
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed an issue updating listeners when using SR-IOV VIP ports.

0 commit comments

Comments
 (0)