Add swift buffer-on-upload options for swift multibackend

Adds ability to set swift_buffer_on_upload and swift_upload_buffer_dir
for swift multi backend

Change-Id: Ic29448860f5c7a8b743abd6f343985e65d8c5693
This commit is contained in:
Sam Morrison 2020-06-16 09:56:00 +10:00
parent 89861ab17a
commit 9d340581b1
3 changed files with 23 additions and 0 deletions

View File

@ -70,6 +70,12 @@
# new images. String value.
# Default to 'ref1'.
#
# [*swift_buffer_on_upload*]
# Optional. Default: $::os_service_default.
#
# [*swift_upload_buffer_dir*]
# Optional. Default: $::os_service_default.
#
# [*store_description*]
# (optional) Provides constructive information about the store backend to
# end users.
@ -90,6 +96,8 @@ define glance::backend::multistore::swift(
$swift_store_region = $::os_service_default,
$swift_store_config_file = $::os_service_default,
$default_swift_reference = 'ref1',
$swift_buffer_on_upload = $::os_service_default,
$swift_upload_buffer_dir = $::os_service_default,
$store_description = $::os_service_default,
) {
@ -108,6 +116,8 @@ define glance::backend::multistore::swift(
"${name}/swift_store_endpoint_type": value => $swift_store_endpoint_type;
"${name}/swift_store_config_file": value => $swift_store_config_file;
"${name}/default_swift_reference": value => $default_swift_reference;
"${name}/swift_buffer_on_upload": value => $swift_buffer_on_upload;
"${name}/swift_upload_buffer_dir": value => $swift_upload_buffer_dir;
"${name}/store_description": value => $store_description;
}

View File

@ -0,0 +1,7 @@
---
features:
- Add new options
glance::backend::multibackend::swift::swift_buffer_on_upload and
glance::backend::multibackend::swift::swift_upload_buffer_dir
Indicate whether or not Glance should buffer image data to disk while
uploading to swift. This enables Glance to resume uploads on error.

View File

@ -48,6 +48,8 @@ describe 'glance::backend::multistore::swift' do
is_expected.to contain_glance_api_config('swift/swift_store_region').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('swift/swift_store_config_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('swift/default_swift_reference').with_value('ref1')
is_expected.to contain_glance_api_config('swift/swift_buffer_on_upload').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('swift/swift_upload_buffer_dir').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_swift_config('ref1/key').with_value('key')
is_expected.to contain_glance_swift_config('ref1/user').with_value('user')
is_expected.to contain_glance_swift_config('ref1/auth_version').with_value('2')
@ -75,6 +77,8 @@ describe 'glance::backend::multistore::swift' do
:swift_store_region => 'RegionTwo',
:swift_store_config_file => '/etc/glance/glance-swift.conf',
:default_swift_reference => 'swift_creds',
:swift_buffer_on_upload => true,
:swift_upload_buffer_dir => '/var/glance/swift',
}
end
@ -88,6 +92,8 @@ describe 'glance::backend::multistore::swift' do
is_expected.to contain_glance_api_config('swift/swift_store_region').with_value('RegionTwo')
is_expected.to contain_glance_api_config('swift/swift_store_config_file').with_value('/etc/glance/glance-swift.conf')
is_expected.to contain_glance_api_config('swift/default_swift_reference').with_value('swift_creds')
is_expected.to contain_glance_api_config('swift/swift_buffer_on_upload').with_value(true)
is_expected.to contain_glance_api_config('swift/swift_upload_buffer_dir').with_value('/var/glance/swift')
is_expected.to contain_glance_swift_config('swift_creds/key').with_value('key2')
is_expected.to contain_glance_swift_config('swift_creds/user').with_value('user2')
is_expected.to contain_glance_swift_config('swift_creds/auth_version').with_value('1')