Switch to live from noop drivers
The switch to live drivers ease greenfield deployments by not requiring deployers to explicitly set live drivers. The switch also helps deployers identify production-ready from experimental drivers. Experimental features like volume and distributor remain defaulted to their noop drivers. This patch also fixes some tests that were not mocked properly. Change-Id: I1e4e3c4f0e4142fa0d0d1ac895b10e2349d79c20
This commit is contained in:
parent
a5f0524fd0
commit
f3b5e6e147
@ -314,17 +314,18 @@
|
||||
# Amphora driver options are amphora_noop_driver,
|
||||
# amphora_haproxy_rest_driver
|
||||
#
|
||||
# amphora_driver = amphora_noop_driver
|
||||
# amphora_driver = amphora_haproxy_rest_driver
|
||||
#
|
||||
# Compute driver options are compute_noop_driver
|
||||
# compute_nova_driver
|
||||
#
|
||||
# compute_driver = compute_noop_driver
|
||||
# compute_driver = compute_nova_driver
|
||||
#
|
||||
# Network driver options are network_noop_driver
|
||||
# allowed_address_pairs_driver
|
||||
#
|
||||
# network_driver = network_noop_driver
|
||||
# network_driver = allowed_address_pairs_driver
|
||||
#
|
||||
# Volume driver options are volume_noop_driver
|
||||
# volume_cinder_driver
|
||||
#
|
||||
|
@ -466,13 +466,13 @@ controller_worker_opts = [
|
||||
default='/etc/octavia/certs/ca_01.pem',
|
||||
help=_('Client CA for the amphora agent to use')),
|
||||
cfg.StrOpt('amphora_driver',
|
||||
default='amphora_noop_driver',
|
||||
default='amphora_haproxy_rest_driver',
|
||||
help=_('Name of the amphora driver to use')),
|
||||
cfg.StrOpt('compute_driver',
|
||||
default='compute_noop_driver',
|
||||
default='compute_nova_driver',
|
||||
help=_('Name of the compute driver to use')),
|
||||
cfg.StrOpt('network_driver',
|
||||
default='network_noop_driver',
|
||||
default='allowed_address_pairs_driver',
|
||||
help=_('Name of the network driver to use')),
|
||||
cfg.StrOpt('volume_driver',
|
||||
default=constants.VOLUME_NOOP_DRIVER,
|
||||
|
@ -701,8 +701,10 @@ class TestAmphoraDriver(base.TestRpc):
|
||||
self.amp_driver.get_supported_availability_zone_metadata)
|
||||
|
||||
def test_validate_availability_zone(self):
|
||||
ref_dict = {consts.COMPUTE_ZONE: 'my_compute_zone'}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
with mock.patch('stevedore.driver.DriverManager.driver') as m_driver:
|
||||
m_driver.validate_availability_zone.return_value = None
|
||||
ref_dict = {consts.COMPUTE_ZONE: 'my_compute_zone'}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
|
||||
# Test bad availability zone metadata key
|
||||
ref_dict = {'bogus': 'bogus'}
|
||||
|
@ -713,16 +713,20 @@ class TestAmphoraDriver(base.TestRpc):
|
||||
|
||||
def test_validate_availability_zone(self):
|
||||
# Test compute zone
|
||||
ref_dict = {consts.COMPUTE_ZONE: 'my_compute_zone'}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
with mock.patch('stevedore.driver.DriverManager.driver') as m_driver:
|
||||
m_driver.validate_availability_zone.return_value = None
|
||||
ref_dict = {consts.COMPUTE_ZONE: 'my_compute_zone'}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
|
||||
# Test vip networks
|
||||
ref_dict = {consts.VALID_VIP_NETWORKS: ['my_vip_net']}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
with mock.patch('octavia.common.utils.get_network_driver') as m_driver:
|
||||
# Test vip networks
|
||||
m_driver.get_network.return_value = None
|
||||
ref_dict = {consts.VALID_VIP_NETWORKS: ['my_vip_net']}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
|
||||
# Test management network
|
||||
ref_dict = {consts.MANAGEMENT_NETWORK: 'my_management_net'}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
# Test management network
|
||||
ref_dict = {consts.MANAGEMENT_NETWORK: 'my_management_net'}
|
||||
self.amp_driver.validate_availability_zone(ref_dict)
|
||||
|
||||
# Test bad availability zone metadata key
|
||||
ref_dict = {'bogus': 'bogus'}
|
||||
|
@ -1238,7 +1238,9 @@ class TestUpdateHealthDb(base.TestCase):
|
||||
}
|
||||
self.hm.amphora_repo.get_lb_for_health_update.return_value = {}
|
||||
|
||||
self.hm.update_health(health, '192.0.2.1')
|
||||
with mock.patch('stevedore.driver.DriverManager.driver') as m_driver:
|
||||
self.hm.update_health(health, '192.0.2.1')
|
||||
self.assertTrue(m_driver.delete.called)
|
||||
|
||||
self.assertTrue(self.amphora_repo.get_lb_for_health_update.called)
|
||||
self.assertFalse(self.amphora_health_repo.replace.called)
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The default drivers have been switched to live from noop drivers for the
|
||||
most part. Volume and distributor remain set to noop drivers as those are
|
||||
experimental features. Operators do not need to make configuration changes.
|
Loading…
Reference in New Issue
Block a user