Add max_request_body_size option support

Octavia enabled sizelimit middleware in API. This introduces support
for the max_request_body_size option so that users can customize
the limit.

Depends-on: https://review.opendev.org/902049
Change-Id: Iab79e9a4d50e65ea663bb5bb5428585dff48720d
This commit is contained in:
Takashi Kajinami 2024-03-13 12:23:33 +09:00
parent ca43069521
commit ae7f1cfe3f
3 changed files with 16 additions and 2 deletions

View File

@ -60,6 +60,10 @@
# HTTPProxyToWSGI middleware.
# Defaults to $facts['os_service_default'].
#
# [*max_request_body_size*]
# (Optional) Set max request body size
# Defaults to $facts['os_service_default'].
#
# [*default_provider_driver*]
# (optional) Configure the default provider driver.
# Defaults to $facts['os_service_default']
@ -135,6 +139,7 @@ class octavia::api (
$allow_tls_terminated_listeners = $facts['os_service_default'],
Boolean $sync_db = false,
$enable_proxy_headers_parsing = $facts['os_service_default'],
$max_request_body_size = $facts['os_service_default'],
$default_provider_driver = $facts['os_service_default'],
$enabled_provider_drivers = $facts['os_service_default'],
$pagination_max_limit = $facts['os_service_default'],
@ -238,5 +243,6 @@ running as a standalone service, or httpd for being run by a httpd server")
oslo::middleware { 'octavia_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing
max_request_body_size => $max_request_body_size,
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``octavia::api::max_request_body_size`` option has been added.

View File

@ -71,6 +71,7 @@ describe 'octavia::api' do
is_expected.to contain_octavia_config('api_settings/allow_prometheus_listeners').with_value('<SERVICE DEFAULT>')
is_expected.to contain_oslo__middleware('octavia_config').with(
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
:max_request_body_size => '<SERVICE DEFAULT>',
)
end
it 'does not sync the database' do
@ -123,14 +124,17 @@ describe 'octavia::api' do
it { is_expected.to contain_class('octavia::db::sync') }
end
context 'with enable_proxy_headers_parsing set' do
context 'with oslo.middleware options set' do
before do
params.merge!({
:enable_proxy_headers_parsing => true})
:enable_proxy_headers_parsing => true,
:max_request_body_size => 114688,
})
end
it 'configures enable_proxy_headers_parsing' do
is_expected.to contain_oslo__middleware('octavia_config').with(
:enable_proxy_headers_parsing => true,
:max_request_body_size => 114688,
)
end
end