Manage oslo_middleware/max_request_body_size

So that we can increase it from the default 114688

Useful in case for example the OS-Federation mapping is too large.

If this limit is breached cinder will return a 413 Entity Too Large
and not log anything to cinder.log.

Change-Id: I4364ef41400ea6c66c843318119f24ef7c47434b
Closes-Bug: #1835161
This commit is contained in:
ZhongShengping 2019-07-04 11:34:42 +08:00
parent 580b2f257a
commit 85b2b1ff67
3 changed files with 12 additions and 0 deletions

View File

@ -90,6 +90,10 @@
# middleware should parse the proxy headers or not.(boolean value)
# Defaults to $::os_service_default
#
# [*max_request_body_size*]
# (Optional) Set max request body size
# Defaults to $::os_service_default.
#
# [*use_ssl*]
# (optional) Enable SSL on the API server
# Defaults to false
@ -174,6 +178,7 @@ class cinder::api (
$osapi_max_limit = $::os_service_default,
$service_name = $::cinder::params::api_service,
$enable_proxy_headers_parsing = $::os_service_default,
$max_request_body_size = $::os_service_default,
$use_ssl = false,
$cert_file = $::os_service_default,
$key_file = $::os_service_default,
@ -291,6 +296,7 @@ running as a standalone service, or httpd for being run by a httpd server")
oslo::middleware {'cinder_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
max_request_body_size => $max_request_body_size,
}
cinder_config {

View File

@ -0,0 +1,5 @@
---
features:
- |
Add support to configure `[oslo_middleware]/max_request_body_size` with
`$max_request_body_size`.

View File

@ -57,6 +57,7 @@ describe 'cinder::api' do
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_listen_port').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_oslo__middleware('cinder_config').with(
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
:max_request_body_size => '<SERVICE DEFAULT>',
)
end
end