Browse Source

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 glance will return a 413 Entity Too Large
and not log anything to glance.log.

Change-Id: If15f7cc9cef9a3bca855a3cd02068d45eedd171f
Closes-Bug: #1835161
changes/37/669037/1 15.1.0
ZhongShengping 2 years ago
parent
commit
643f342304
  1. 6
      manifests/api.pp
  2. 5
      releasenotes/notes/max_request_body_size-91efd06b477a9ff8.yaml
  3. 10
      spec/classes/glance_api_spec.rb

6
manifests/api.pp

@ -240,6 +240,10 @@
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
# [*max_request_body_size*]
# (Optional) Set max request body size
# Defaults to $::os_service_default.
#
# [*enable_v1_api*]
# (Optional) Enable or not Glance API v1.
# If you enable this option, you'll get a deprecation warning in Glance
@ -354,6 +358,7 @@ class glance::api(
$conversion_format = $::os_service_default,
$os_region_name = 'RegionOne',
$enable_proxy_headers_parsing = $::os_service_default,
$max_request_body_size = $::os_service_default,
$enable_v1_api = false,
$enable_v2_api = $::os_service_default,
$sync_db = true,
@ -542,6 +547,7 @@ class glance::api(
oslo::middleware { 'glance_api_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
max_request_body_size => $max_request_body_size,
}
# SSL Options

5
releasenotes/notes/max_request_body_size-91efd06b477a9ff8.yaml

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

10
spec/classes/glance_api_spec.rb

@ -291,6 +291,16 @@ describe 'glance::api' do
)}
end
describe 'setting max_request_body_size' do
let :params do
default_params.merge({:max_request_body_size => '102400' })
end
it { is_expected.to contain_oslo__middleware('glance_api_config').with(
:max_request_body_size => '102400',
)}
end
describe 'with ssl options' do
let :params do
default_params.merge({

Loading…
Cancel
Save