Add support for [oslo_middleware] enable_proxy_headers_parsing
The enable_proxy_haders_parsing parameter was added into Octavia[1] so that Octavia API can set up the request URL correctly. This patch adds support for this parameter in octaiva::api module, so that operators can set it according to their deployment architecture. [1] https://review.opendev.org/#/c/639736/ Change-Id: I985abb8e5dcd6d29e794b200982f8bce99ac316c
This commit is contained in:
parent
77c5cdb43d
commit
ddc7986e18
@ -55,6 +55,11 @@
|
||||
# (optional) Run octavia-db-manage upgrade head on api nodes after installing the package.
|
||||
# Defaults to false
|
||||
#
|
||||
# [*enable_proxy_headers_parsing*]
|
||||
# (Optional) Enable paste middleware to handle SSL requests through
|
||||
# HTTPProxyToWSGI middleware.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*default_provider_driver*]
|
||||
# (optional) Configure the default provider driver.
|
||||
# Defaults to $::os_service_default
|
||||
@ -82,6 +87,7 @@ class octavia::api (
|
||||
$api_v2_enabled = $::os_service_default,
|
||||
$allow_tls_terminated_listeners = $::os_service_default,
|
||||
$sync_db = false,
|
||||
$enable_proxy_headers_parsing = $::os_service_default,
|
||||
$default_provider_driver = $::os_service_default,
|
||||
$provider_drivers = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
@ -150,4 +156,8 @@ class octavia::api (
|
||||
'api_settings/default_provider_driver': value => $default_provider_driver;
|
||||
'api_settings/enabled_provider_drivers': value => $provider_drivers;
|
||||
}
|
||||
|
||||
oslo::middleware { 'octavia_config':
|
||||
enable_proxy_headers_parsing => $enable_proxy_headers_parsing
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``octavia::api::enable_proxy_headers_parsing`` parameter was added
|
||||
to support ``enable_proxy_headers_parsing`` parameter in Octavia.
|
@ -53,6 +53,9 @@ describe 'octavia::api' do
|
||||
is_expected.to contain_octavia_config('api_settings/allow_tls_terminated_listeners').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('api_settings/default_provider_driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_octavia_config('api_settings/enabled_provider_drivers').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_oslo__middleware('octavia_config').with(
|
||||
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
|
||||
)
|
||||
end
|
||||
it 'does not sync the database' do
|
||||
is_expected.not_to contain_class('octavia::db::sync')
|
||||
@ -99,6 +102,18 @@ describe 'octavia::api' do
|
||||
it { is_expected.to contain_class('octavia::db::sync') }
|
||||
end
|
||||
|
||||
context 'with enable_proxy_headers_parsing set' do
|
||||
before do
|
||||
params.merge!({
|
||||
:enable_proxy_headers_parsing => true})
|
||||
end
|
||||
it 'configures enable_proxy_headers_parsing' do
|
||||
is_expected.to contain_oslo__middleware('octavia_config').with(
|
||||
:enable_proxy_headers_parsing => true,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with disabled service managing' do
|
||||
before do
|
||||
params.merge!({
|
||||
|
Loading…
Reference in New Issue
Block a user