Browse Source

Merge "Fix pools going into ERROR when updating the pool" into stable/train

changes/49/778949/1
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
886f890ee5
5 changed files with 42 additions and 14 deletions
  1. +5
    -5
      octavia/api/drivers/amphora_driver/v1/driver.py
  2. +6
    -5
      octavia/api/drivers/amphora_driver/v2/driver.py
  3. +13
    -2
      octavia/tests/unit/api/drivers/amphora_driver/v1/test_amphora_driver.py
  4. +13
    -2
      octavia/tests/unit/api/drivers/amphora_driver/v2/test_amphora_driver.py
  5. +5
    -0
      releasenotes/notes/fix-pool-crl-2cc6f2705f5b2009.yaml

+ 5
- 5
octavia/api/drivers/amphora_driver/v1/driver.py View File

@ -172,16 +172,16 @@ class AmphoraProviderDriver(driver_base.ProviderDriver):
pool_dict['enabled'] = pool_dict.pop('admin_state_up')
pool_id = pool_dict.pop('pool_id')
if 'tls_container_ref' in pool_dict:
pool_dict['tls_container_id'] = pool_dict.pop('tls_container_ref')
pool_dict['tls_certificate_id'] = pool_dict.pop(
'tls_container_ref')
pool_dict.pop('tls_container_data', None)
if 'ca_tls_container_ref' in pool_dict:
pool_dict['ca_tls_certificate_id'] = pool_dict.pop(
'ca_tls_container_ref')
pool_dict.pop('ca_tls_container_data', None)
if 'client_crl_container_ref' in pool_dict:
pool_dict['client_crl_container_id'] = pool_dict.pop(
'client_crl_container_ref')
pool_dict.pop('client_crl_container_data', None)
if 'crl_container_ref' in pool_dict:
pool_dict['crl_container_id'] = pool_dict.pop('crl_container_ref')
pool_dict.pop('crl_container_data', None)
payload = {consts.POOL_ID: pool_id,
consts.POOL_UPDATES: pool_dict}


+ 6
- 5
octavia/api/drivers/amphora_driver/v2/driver.py View File

@ -168,16 +168,17 @@ class AmphoraProviderDriver(driver_base.ProviderDriver):
pool_dict['enabled'] = pool_dict.pop('admin_state_up')
pool_id = pool_dict.pop('pool_id')
if 'tls_container_ref' in pool_dict:
pool_dict['tls_container_id'] = pool_dict.pop('tls_container_ref')
pool_dict['tls_certificate_id'] = pool_dict.pop(
'tls_container_ref')
pool_dict.pop('tls_container_data', None)
if 'ca_tls_container_ref' in pool_dict:
pool_dict['ca_tls_certificate_id'] = pool_dict.pop(
'ca_tls_container_ref')
pool_dict.pop('ca_tls_container_data', None)
if 'client_crl_container_ref' in pool_dict:
pool_dict['client_crl_container_id'] = pool_dict.pop(
'client_crl_container_ref')
pool_dict.pop('client_crl_container_data', None)
if 'crl_container_ref' in pool_dict:
pool_dict['crl_container_id'] = pool_dict.pop(
'crl_container_ref')
pool_dict.pop('crl_container_data', None)
payload = {consts.POOL_ID: pool_id,
consts.POOL_UPDATES: pool_dict}


+ 13
- 2
octavia/tests/unit/api/drivers/amphora_driver/v1/test_amphora_driver.py View File

@ -210,8 +210,19 @@ class TestAmphoraDriver(base.TestRpc):
old_provider_pool = driver_dm.Pool(
pool_id=self.sample_data.pool1_id)
provider_pool = driver_dm.Pool(
pool_id=self.sample_data.pool1_id, admin_state_up=True)
pool_dict = {'enabled': True}
pool_id=self.sample_data.pool1_id, admin_state_up=True,
ca_tls_container_data='CA DATA', ca_tls_container_ref='CA REF',
crl_container_data='CRL DATA', crl_container_ref='CRL REF',
description='TEST DESCRIPTION', name='TEST NAME',
lb_algorithm=consts.LB_ALGORITHM_SOURCE_IP,
session_persistence='FAKE SP', tls_container_data='TLS DATA',
tls_container_ref='TLS REF', tls_enabled=False)
pool_dict = {'description': 'TEST DESCRIPTION',
'lb_algorithm': 'SOURCE_IP', 'name': 'TEST NAME',
'session_persistence': 'FAKE SP', 'tls_enabled': False,
'enabled': True, 'tls_certificate_id': 'TLS REF',
'ca_tls_certificate_id': 'CA REF',
'crl_container_id': 'CRL REF'}
self.amp_driver.pool_update(old_provider_pool, provider_pool)
payload = {consts.POOL_ID: self.sample_data.pool1_id,
consts.POOL_UPDATES: pool_dict}


+ 13
- 2
octavia/tests/unit/api/drivers/amphora_driver/v2/test_amphora_driver.py View File

@ -210,8 +210,19 @@ class TestAmphoraDriver(base.TestRpc):
old_provider_pool = driver_dm.Pool(
pool_id=self.sample_data.pool1_id)
provider_pool = driver_dm.Pool(
pool_id=self.sample_data.pool1_id, admin_state_up=True)
pool_dict = {'enabled': True}
pool_id=self.sample_data.pool1_id, admin_state_up=True,
ca_tls_container_data='CA DATA', ca_tls_container_ref='CA REF',
crl_container_data='CRL DATA', crl_container_ref='CRL REF',
description='TEST DESCRIPTION', name='TEST NAME',
lb_algorithm=consts.LB_ALGORITHM_SOURCE_IP,
session_persistence='FAKE SP', tls_container_data='TLS DATA',
tls_container_ref='TLS REF', tls_enabled=False)
pool_dict = {'description': 'TEST DESCRIPTION',
'lb_algorithm': 'SOURCE_IP', 'name': 'TEST NAME',
'session_persistence': 'FAKE SP', 'tls_enabled': False,
'enabled': True, 'tls_certificate_id': 'TLS REF',
'ca_tls_certificate_id': 'CA REF',
'crl_container_id': 'CRL REF'}
self.amp_driver.pool_update(old_provider_pool, provider_pool)
payload = {consts.POOL_ID: self.sample_data.pool1_id,
consts.POOL_UPDATES: pool_dict}


+ 5
- 0
releasenotes/notes/fix-pool-crl-2cc6f2705f5b2009.yaml View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixed an issue were updating a CRL or client certificate on a pool would
cause the pool to go into ERROR.

Loading…
Cancel
Save