Browse Source

Merge "Update the lb_id on an amp earlier if we know it" into stable/train

tags/5.0.2
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
774984f638
8 changed files with 40 additions and 1 deletions
  1. +1
    -0
      octavia/controller/worker/v1/flows/amphora_flows.py
  2. +2
    -0
      octavia/controller/worker/v1/tasks/database_tasks.py
  3. +1
    -0
      octavia/controller/worker/v2/flows/amphora_flows.py
  4. +2
    -0
      octavia/controller/worker/v2/tasks/database_tasks.py
  5. +1
    -0
      octavia/tests/unit/controller/worker/v1/tasks/test_database_tasks.py
  6. +23
    -1
      octavia/tests/unit/controller/worker/v2/flows/test_amphora_flows.py
  7. +1
    -0
      octavia/tests/unit/controller/worker/v2/tasks/test_database_tasks.py
  8. +9
    -0
      releasenotes/notes/link-amphora-to-loadbalancer-earlier-ab3dddec48b8da96.yaml

+ 1
- 0
octavia/controller/worker/v1/flows/amphora_flows.py View File

@@ -121,6 +121,7 @@ class AmphoraFlows(object):
create_amp_for_lb_subflow = linear_flow.Flow(sf_name)
create_amp_for_lb_subflow.add(database_tasks.CreateAmphoraInDB(
name=sf_name + '-' + constants.CREATE_AMPHORA_INDB,
requires=constants.LOADBALANCER_ID,
provides=constants.AMPHORA_ID))

require_server_group_id_condition = (


+ 2
- 0
octavia/controller/worker/v1/tasks/database_tasks.py View File

@@ -95,8 +95,10 @@ class CreateAmphoraInDB(BaseDatabaseTask):
:returns: The created amphora object
"""

loadbalancer_id = kwargs.get("loadbalancer_id", None)
amphora = self.amphora_repo.create(db_apis.get_session(),
id=uuidutils.generate_uuid(),
load_balancer_id=loadbalancer_id,
status=constants.PENDING_CREATE,
cert_busy=False)



+ 1
- 0
octavia/controller/worker/v2/flows/amphora_flows.py View File

@@ -121,6 +121,7 @@ class AmphoraFlows(object):
create_amp_for_lb_subflow = linear_flow.Flow(sf_name)
create_amp_for_lb_subflow.add(database_tasks.CreateAmphoraInDB(
name=sf_name + '-' + constants.CREATE_AMPHORA_INDB,
requires=constants.LOADBALANCER_ID,
provides=constants.AMPHORA_ID))

require_server_group_id_condition = (


+ 2
- 0
octavia/controller/worker/v2/tasks/database_tasks.py View File

@@ -95,8 +95,10 @@ class CreateAmphoraInDB(BaseDatabaseTask):
:returns: The created amphora object
"""

loadbalancer_id = kwargs.get("loadbalancer_id", None)
amphora = self.amphora_repo.create(db_apis.get_session(),
id=uuidutils.generate_uuid(),
load_balancer_id=loadbalancer_id,
status=constants.PENDING_CREATE,
cert_busy=False)



+ 1
- 0
octavia/tests/unit/controller/worker/v1/tasks/test_database_tasks.py View File

@@ -147,6 +147,7 @@ class TestDatabaseTasks(base.TestCase):
repo.AmphoraRepository.create.assert_called_once_with(
'TEST',
id=AMP_ID,
load_balancer_id=None,
status=constants.PENDING_CREATE,
cert_busy=False)



+ 23
- 1
octavia/tests/unit/controller/worker/v2/flows/test_amphora_flows.py View File

@@ -80,6 +80,8 @@ class TestAmphoraFlows(base.TestCase):

self.assertIsInstance(amp_flow, flow.Flow)

self.assertIn(constants.FLAVOR, amp_flow.requires)
self.assertIn(constants.BUILD_TYPE_PRIORITY, amp_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)

self.assertIn(constants.AMPHORA, amp_flow.provides)
@@ -100,6 +102,8 @@ class TestAmphoraFlows(base.TestCase):

self.assertIsInstance(amp_flow, flow.Flow)

self.assertIn(constants.FLAVOR, amp_flow.requires)
self.assertIn(constants.BUILD_TYPE_PRIORITY, amp_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)

self.assertIn(constants.AMPHORA, amp_flow.provides)
@@ -121,6 +125,8 @@ class TestAmphoraFlows(base.TestCase):

self.assertIsInstance(amp_flow, flow.Flow)

self.assertIn(constants.FLAVOR, amp_flow.requires)
self.assertIn(constants.BUILD_TYPE_PRIORITY, amp_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)

self.assertIn(constants.AMPHORA, amp_flow.provides)
@@ -142,8 +148,14 @@ class TestAmphoraFlows(base.TestCase):
'SOMEPREFIX', constants.ROLE_MASTER)

self.assertIsInstance(amp_flow, flow.Flow)
self.assertIn(constants.AMPHORA_ID, amp_flow.provides)

self.assertIn(constants.FLAVOR, amp_flow.requires)
self.assertIn(constants.BUILD_TYPE_PRIORITY, amp_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)
self.assertIn(constants.SERVER_GROUP_ID, amp_flow.requires)

self.assertIn(constants.AMPHORA, amp_flow.provides)
self.assertIn(constants.AMPHORA_ID, amp_flow.provides)
self.assertIn(constants.COMPUTE_ID, amp_flow.provides)
self.assertIn(constants.COMPUTE_OBJ, amp_flow.provides)
self.assertIn(constants.SERVER_PEM, amp_flow.provides)
@@ -161,6 +173,8 @@ class TestAmphoraFlows(base.TestCase):

self.assertIsInstance(amp_flow, flow.Flow)

self.assertIn(constants.FLAVOR, amp_flow.requires)
self.assertIn(constants.BUILD_TYPE_PRIORITY, amp_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)

self.assertIn(constants.AMPHORA, amp_flow.provides)
@@ -181,6 +195,8 @@ class TestAmphoraFlows(base.TestCase):

self.assertIsInstance(amp_flow, flow.Flow)

self.assertIn(constants.FLAVOR, amp_flow.requires)
self.assertIn(constants.BUILD_TYPE_PRIORITY, amp_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)

self.assertIn(constants.AMPHORA, amp_flow.provides)
@@ -201,6 +217,12 @@ class TestAmphoraFlows(base.TestCase):
'SOMEPREFIX', constants.ROLE_BACKUP)

self.assertIsInstance(amp_flow, flow.Flow)

self.assertIn(constants.FLAVOR, amp_flow.requires)
self.assertIn(constants.BUILD_TYPE_PRIORITY, amp_flow.requires)
self.assertIn(constants.LOADBALANCER_ID, amp_flow.requires)
self.assertIn(constants.SERVER_GROUP_ID, amp_flow.requires)

self.assertIn(constants.AMPHORA_ID, amp_flow.provides)
self.assertIn(constants.SERVER_GROUP_ID, amp_flow.requires)
self.assertIn(constants.COMPUTE_ID, amp_flow.provides)


+ 1
- 0
octavia/tests/unit/controller/worker/v2/tasks/test_database_tasks.py View File

@@ -147,6 +147,7 @@ class TestDatabaseTasks(base.TestCase):
repo.AmphoraRepository.create.assert_called_once_with(
'TEST',
id=AMP_ID,
load_balancer_id=None,
status=constants.PENDING_CREATE,
cert_busy=False)



+ 9
- 0
releasenotes/notes/link-amphora-to-loadbalancer-earlier-ab3dddec48b8da96.yaml View File

@@ -0,0 +1,9 @@
---
other:
- |
Amphorae that are booting for a specific loadbalancer will now be linked to
that loadbalancer immediately upon creation. Previously this would not
happen until near the end of the process, leaving a gap during booting
during which is was difficult to understand which booting amphora belonged
to which loadbalancer. This was especially problematic when attempting to
troubleshoot loadbalancers that entered ERROR status due to boot issues.

Loading…
Cancel
Save