Add alpn_protocols to the pool data model

This change completes the ALPN support started in Victoria and initially
limited to listeners. Now with pools supported as well, this feature
work is completed in octavia-lib.

Change-Id: I01268f7afac8f6356616f3926d6fe9c1ec31b2b5
This commit is contained in:
Carlos Goncalves 2020-09-15 08:18:57 +00:00 committed by Michael Johnson
parent c6fb93a53d
commit 0bc8c6a0b8
3 changed files with 19 additions and 3 deletions

View File

@ -177,7 +177,8 @@ class Pool(BaseDataModel):
tls_container_data=Unset, ca_tls_container_ref=Unset,
ca_tls_container_data=Unset, crl_container_ref=Unset,
crl_container_data=Unset, tls_enabled=Unset,
project_id=Unset, tls_versions=Unset, tls_ciphers=Unset):
project_id=Unset, tls_versions=Unset, tls_ciphers=Unset,
alpn_protocols=Unset):
self.admin_state_up = admin_state_up
self.description = description
@ -200,6 +201,7 @@ class Pool(BaseDataModel):
self.project_id = project_id
self.tls_versions = tls_versions
self.tls_ciphers = tls_ciphers
self.alpn_protocols = alpn_protocols
class Member(BaseDataModel):

View File

@ -183,7 +183,10 @@ class TestProviderDataModels(base.TestCase):
constants.TLS_VERSION_1_1,
constants.TLS_VERSION_1_2,
constants.TLS_VERSION_1_3],
tls_ciphers=None)
tls_ciphers=None,
alpn_protocols=[constants.ALPN_PROTOCOL_HTTP_1_0,
constants.ALPN_PROTOCOL_HTTP_1_1,
constants.ALPN_PROTOCOL_HTTP_2])
self.ref_l7rule_dict = {'admin_state_up': True,
'compare_type': 'STARTS_WITH',
@ -332,7 +335,10 @@ class TestProviderDataModels(base.TestCase):
constants.TLS_VERSION_1_1,
constants.TLS_VERSION_1_2,
constants.TLS_VERSION_1_3],
'tls_ciphers': None}
'tls_ciphers': None,
'alpn_protocols': [constants.ALPN_PROTOCOL_HTTP_1_0,
constants.ALPN_PROTOCOL_HTTP_1_1,
constants.ALPN_PROTOCOL_HTTP_2]}
def test_equality(self):
second_ref_lb = deepcopy(self.ref_lb)
@ -378,6 +384,7 @@ class TestProviderDataModels(base.TestCase):
ref_pool_dict['healthmonitor'] = None
ref_pool_dict.pop('members', None)
ref_pool_dict.pop('tls_versions', None)
ref_pool_dict.pop('alpn_protocols', None)
ref_l7policy_dict = deepcopy(self.ref_l7policy_dict)
ref_l7policy_dict.pop('rules', None)

View File

@ -0,0 +1,7 @@
---
features:
- |
Added parameter ``alpn_protocols`` to pools. This parameter contains
the list of protocols supported by pools, in descending order of
preference. The supported protocols are ``http/1.0``, ``http/1.1``
and ``h2``.