Merge "Update the lb_id on an amp earlier if we know it" into stable/train
This commit is contained in:
commit
774984f638
|
@ -121,6 +121,7 @@ class AmphoraFlows(object):
|
||||||
create_amp_for_lb_subflow = linear_flow.Flow(sf_name)
|
create_amp_for_lb_subflow = linear_flow.Flow(sf_name)
|
||||||
create_amp_for_lb_subflow.add(database_tasks.CreateAmphoraInDB(
|
create_amp_for_lb_subflow.add(database_tasks.CreateAmphoraInDB(
|
||||||
name=sf_name + '-' + constants.CREATE_AMPHORA_INDB,
|
name=sf_name + '-' + constants.CREATE_AMPHORA_INDB,
|
||||||
|
requires=constants.LOADBALANCER_ID,
|
||||||
provides=constants.AMPHORA_ID))
|
provides=constants.AMPHORA_ID))
|
||||||
|
|
||||||
require_server_group_id_condition = (
|
require_server_group_id_condition = (
|
||||||
|
|
|
@ -95,8 +95,10 @@ class CreateAmphoraInDB(BaseDatabaseTask):
|
||||||
:returns: The created amphora object
|
:returns: The created amphora object
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
loadbalancer_id = kwargs.get("loadbalancer_id", None)
|
||||||
amphora = self.amphora_repo.create(db_apis.get_session(),
|
amphora = self.amphora_repo.create(db_apis.get_session(),
|
||||||
id=uuidutils.generate_uuid(),
|
id=uuidutils.generate_uuid(),
|
||||||
|
load_balancer_id=loadbalancer_id,
|
||||||
status=constants.PENDING_CREATE,
|
status=constants.PENDING_CREATE,
|
||||||
cert_busy=False)
|
cert_busy=False)
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ class AmphoraFlows(object):
|
||||||
create_amp_for_lb_subflow = linear_flow.Flow(sf_name)
|
create_amp_for_lb_subflow = linear_flow.Flow(sf_name)
|
||||||
create_amp_for_lb_subflow.add(database_tasks.CreateAmphoraInDB(
|
create_amp_for_lb_subflow.add(database_tasks.CreateAmphoraInDB(
|
||||||
name=sf_name + '-' + constants.CREATE_AMPHORA_INDB,
|
name=sf_name + '-' + constants.CREATE_AMPHORA_INDB,
|
||||||
|
requires=constants.LOADBALANCER_ID,
|
||||||
provides=constants.AMPHORA_ID))
|
provides=constants.AMPHORA_ID))
|
||||||
|
|
||||||
require_server_group_id_condition = (
|
require_server_group_id_condition = (
|
||||||
|
|
|
@ -95,8 +95,10 @@ class CreateAmphoraInDB(BaseDatabaseTask):
|
||||||
:returns: The created amphora object
|
:returns: The created amphora object
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
loadbalancer_id = kwargs.get("loadbalancer_id", None)
|
||||||
amphora = self.amphora_repo.create(db_apis.get_session(),
|
amphora = self.amphora_repo.create(db_apis.get_session(),
|
||||||
id=uuidutils.generate_uuid(),
|
id=uuidutils.generate_uuid(),
|
||||||
|
load_balancer_id=loadbalancer_id,
|
||||||
status=constants.PENDING_CREATE,
|
status=constants.PENDING_CREATE,
|
||||||
cert_busy=False)
|
cert_busy=False)
|
||||||
|
|
||||||
|
|
|
@ -147,6 +147,7 @@ class TestDatabaseTasks(base.TestCase):
|
||||||
repo.AmphoraRepository.create.assert_called_once_with(
|
repo.AmphoraRepository.create.assert_called_once_with(
|
||||||
'TEST',
|
'TEST',
|
||||||
id=AMP_ID,
|
id=AMP_ID,
|
||||||
|
load_balancer_id=None,
|
||||||
status=constants.PENDING_CREATE,
|
status=constants.PENDING_CREATE,
|
||||||
cert_busy=False)
|
cert_busy=False)
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,8 @@ class TestAmphoraFlows(base.TestCase):
|
||||||
|
|
||||||
self.assertIsInstance(amp_flow, flow.Flow)
|
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.LOADBALANCER_ID, amp_flow.requires)
|
||||||
|
|
||||||
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
||||||
|
@ -100,6 +102,8 @@ class TestAmphoraFlows(base.TestCase):
|
||||||
|
|
||||||
self.assertIsInstance(amp_flow, flow.Flow)
|
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.LOADBALANCER_ID, amp_flow.requires)
|
||||||
|
|
||||||
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
||||||
|
@ -121,6 +125,8 @@ class TestAmphoraFlows(base.TestCase):
|
||||||
|
|
||||||
self.assertIsInstance(amp_flow, flow.Flow)
|
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.LOADBALANCER_ID, amp_flow.requires)
|
||||||
|
|
||||||
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
||||||
|
@ -142,8 +148,14 @@ class TestAmphoraFlows(base.TestCase):
|
||||||
'SOMEPREFIX', constants.ROLE_MASTER)
|
'SOMEPREFIX', constants.ROLE_MASTER)
|
||||||
|
|
||||||
self.assertIsInstance(amp_flow, flow.Flow)
|
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.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_ID, amp_flow.provides)
|
||||||
self.assertIn(constants.COMPUTE_OBJ, amp_flow.provides)
|
self.assertIn(constants.COMPUTE_OBJ, amp_flow.provides)
|
||||||
self.assertIn(constants.SERVER_PEM, 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.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.LOADBALANCER_ID, amp_flow.requires)
|
||||||
|
|
||||||
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
||||||
|
@ -181,6 +195,8 @@ class TestAmphoraFlows(base.TestCase):
|
||||||
|
|
||||||
self.assertIsInstance(amp_flow, flow.Flow)
|
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.LOADBALANCER_ID, amp_flow.requires)
|
||||||
|
|
||||||
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
self.assertIn(constants.AMPHORA, amp_flow.provides)
|
||||||
|
@ -201,6 +217,12 @@ class TestAmphoraFlows(base.TestCase):
|
||||||
'SOMEPREFIX', constants.ROLE_BACKUP)
|
'SOMEPREFIX', constants.ROLE_BACKUP)
|
||||||
|
|
||||||
self.assertIsInstance(amp_flow, flow.Flow)
|
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.AMPHORA_ID, amp_flow.provides)
|
||||||
self.assertIn(constants.SERVER_GROUP_ID, amp_flow.requires)
|
self.assertIn(constants.SERVER_GROUP_ID, amp_flow.requires)
|
||||||
self.assertIn(constants.COMPUTE_ID, amp_flow.provides)
|
self.assertIn(constants.COMPUTE_ID, amp_flow.provides)
|
||||||
|
|
|
@ -147,6 +147,7 @@ class TestDatabaseTasks(base.TestCase):
|
||||||
repo.AmphoraRepository.create.assert_called_once_with(
|
repo.AmphoraRepository.create.assert_called_once_with(
|
||||||
'TEST',
|
'TEST',
|
||||||
id=AMP_ID,
|
id=AMP_ID,
|
||||||
|
load_balancer_id=None,
|
||||||
status=constants.PENDING_CREATE,
|
status=constants.PENDING_CREATE,
|
||||||
cert_busy=False)
|
cert_busy=False)
|
||||||
|
|
||||||
|
|
|
@ -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…
Reference in New Issue