Browse Source

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
(cherry picked from commit ddc7986e18)
changes/64/736864/1
Takashi Kajinami 2 weeks ago
parent
commit
4b7ee3307c
3 changed files with 30 additions and 0 deletions
  1. +10
    -0
      manifests/api.pp
  2. +5
    -0
      releasenotes/notes/add-api-enable_proxy_headers_parsing-e04ae349155978bc.yaml
  3. +15
    -0
      spec/classes/octavia_api_spec.rb

+ 10
- 0
manifests/api.pp View File

@@ -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
}
}

+ 5
- 0
releasenotes/notes/add-api-enable_proxy_headers_parsing-e04ae349155978bc.yaml View File

@@ -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.

+ 15
- 0
spec/classes/octavia_api_spec.rb View File

@@ -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…
Cancel
Save