Browse Source

Fix amphora failover flow in amphorav2 driver

Remove amphora_id from the failover flow parameters in amphorav2, it is
unused and it hides in a later task the amphora_id of the newly created
amphora, breaking a simple amphora failover.

Story 2008848
Task 42360

Change-Id: Idd9021c8a73d1be87f5df40d3f27c0fba9067e3c
changes/67/787667/1
Gregory Thiemonge 5 months ago
parent
commit
7e2dab64a0
  1. 3
      octavia/controller/worker/v2/controller_worker.py
  2. 21
      octavia/tests/unit/controller/worker/v2/test_controller_worker.py
  3. 5
      releasenotes/notes/fix-amphora-failover-amphorav2-b19a76ccfdc75245.yaml

3
octavia/controller/worker/v2/controller_worker.py

@ -945,8 +945,7 @@ class ControllerWorker(object):
constants.LOADBALANCER: provider_lb_dict,
constants.SERVER_GROUP_ID: server_group_id,
constants.LOADBALANCER_ID: lb_id,
constants.VIP: vip_dict,
constants.AMPHORA_ID: amphora_id}
constants.VIP: vip_dict}
self.run_flow(
flow_utils.get_failover_amphora_flow,

21
octavia/tests/unit/controller/worker/v2/test_controller_worker.py

@ -1270,8 +1270,7 @@ class TestControllerWorker(base.TestCase):
constants.LOADBALANCER: mock_provider_lb.to_dict(),
constants.LOADBALANCER_ID: LB_ID,
constants.SERVER_GROUP_ID: None,
constants.VIP: mock_lb.vip.to_dict(),
constants.AMPHORA_ID: AMP_ID}
constants.VIP: mock_lb.vip.to_dict()}
cw = controller_worker.ControllerWorker()
cw.services_controller.reset_mock()
@ -1326,8 +1325,7 @@ class TestControllerWorker(base.TestCase):
constants.LOADBALANCER: mock_provider_lb.to_dict(),
constants.LOADBALANCER_ID: LB_ID,
constants.SERVER_GROUP_ID: None,
constants.VIP: mock_lb.vip.to_dict(),
constants.AMPHORA_ID: AMP_ID}
constants.VIP: mock_lb.vip.to_dict()}
cw = controller_worker.ControllerWorker()
cw.services_controller.reset_mock()
@ -1382,8 +1380,7 @@ class TestControllerWorker(base.TestCase):
constants.LOADBALANCER: mock_provider_lb.to_dict(),
constants.LOADBALANCER_ID: LB_ID,
constants.SERVER_GROUP_ID: SERVER_GROUP_ID,
constants.VIP: mock_lb.vip.to_dict(),
constants.AMPHORA_ID: AMP_ID}
constants.VIP: mock_lb.vip.to_dict()}
cw = controller_worker.ControllerWorker()
cw.services_controller.reset_mock()
@ -1435,8 +1432,7 @@ class TestControllerWorker(base.TestCase):
constants.LOADBALANCER: mock_provider_lb.to_dict(),
constants.LOADBALANCER_ID: LB_ID,
constants.SERVER_GROUP_ID: SERVER_GROUP_ID,
constants.VIP: mock_lb.vip.to_dict(),
constants.AMPHORA_ID: AMP_ID}
constants.VIP: mock_lb.vip.to_dict()}
cw = controller_worker.ControllerWorker()
cw.services_controller.reset_mock()
@ -1492,8 +1488,7 @@ class TestControllerWorker(base.TestCase):
constants.LOADBALANCER: mock_provider_lb.to_dict(),
constants.LOADBALANCER_ID: LB_ID,
constants.SERVER_GROUP_ID: None,
constants.VIP: mock_lb.vip.to_dict(),
constants.AMPHORA_ID: AMP_ID}
constants.VIP: mock_lb.vip.to_dict()}
mock_get_flavor_meta.return_value = {'taste': 'spicy'}
cw = controller_worker.ControllerWorker()
@ -1549,8 +1544,7 @@ class TestControllerWorker(base.TestCase):
constants.LOADBALANCER: mock_provider_lb.to_dict(),
constants.LOADBALANCER_ID: LB_ID,
constants.SERVER_GROUP_ID: None,
constants.VIP: mock_lb.vip.to_dict(),
constants.AMPHORA_ID: AMP_ID}
constants.VIP: mock_lb.vip.to_dict()}
mock_get_az_meta.return_value = {'planet': 'jupiter'}
cw = controller_worker.ControllerWorker()
@ -1666,8 +1660,7 @@ class TestControllerWorker(base.TestCase):
constants.LOADBALANCER: None,
constants.LOADBALANCER_ID: None,
constants.SERVER_GROUP_ID: None,
constants.VIP: {},
constants.AMPHORA_ID: AMP_ID}
constants.VIP: {}}
cw = controller_worker.ControllerWorker()
cw.services_controller.reset_mock()

5
releasenotes/notes/fix-amphora-failover-amphorav2-b19a76ccfdc75245.yaml

@ -0,0 +1,5 @@
---
fixes:
- |
Fix an issue with amphorav2 driver, a failover of an amphora created an
amphora with an ERROR status.
Loading…
Cancel
Save