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

This commit is contained in:
Zuul 2020-06-26 00:20:59 +00:00 committed by Gerrit Code Review
commit 774984f638
8 changed files with 40 additions and 1 deletions

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 = (

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)

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 = (

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)

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)

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)

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)

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.