object-expirer: Update the default pipeline

This change updates the default pipeline of object-expirer, so that
we follow what is described in the default object-expirer.conf
maintained in swift repo.

Change-Id: I58cf2bc21a0bc4265114b9daf3919a1a38f63649
This commit is contained in:
Takashi Kajinami 2021-01-26 21:08:48 +09:00
parent a57d5fe28a
commit 35bde99762
3 changed files with 22 additions and 10 deletions

View File

@ -15,7 +15,7 @@
#
# [*pipeline*]
# (optional) The list of elements of the object expirer pipeline.
# Defaults to ['catch_errors', 'cache', 'proxy-server']
# Defaults to ['catch_errors', 'proxy-logging', 'cache', 'proxy-server']
#
# [*auto_create_account_prefix*]
# (optional) Prefix to use when automatically creating accounts.
@ -68,7 +68,7 @@
# (optional)
# A list of the memcache servers to be used. Entries should be in the
# form host:port. This value is only used if 'cache' is added to the
# pipeline, e.g. ['catch_errors', 'cache', 'proxy-server']
# pipeline, e.g. ['catch_errors', 'proxy-logging', 'cache', 'proxy-server']
# Defaults to ['127.0.0.1:11211']
#
# [*cache_tls_enabled*]
@ -109,7 +109,7 @@ class swift::objectexpirer(
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$pipeline = ['catch_errors', 'proxy-server'],
$pipeline = ['catch_errors', 'proxy-logging', 'cache', 'proxy-server'],
$auto_create_account_prefix = '.',
$concurrency = 1,
$expiring_objects_account_name = 'expiring_objects',
@ -160,6 +160,10 @@ class swift::objectexpirer(
}
}
swift_object_expirer_config {
'filter:proxy-logging/use': value => 'egg:swift#proxy_logging'
}
swift_object_expirer_config {
'pipeline:main/pipeline': value => join($pipeline, ' ');
'object-expirer/auto_create_account_prefix': value => $auto_create_account_prefix;

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
Default value of the ``swift::objectexpirer::pipeline`` parameter has been
changed and now includes ``proxy-logging`` and ``cache`` by default.
The updated value is consistent with the one described in the default
object-expirer.conf in swift.

View File

@ -6,7 +6,7 @@ describe 'swift::objectexpirer' do
{ :manage_service => true,
:enabled => true,
:package_ensure => 'present',
:pipeline => ['catch_errors', 'proxy-server'],
:pipeline => ['catch_errors', 'proxy-logging', 'cache', 'proxy-server'],
:auto_create_account_prefix => '.',
:concurrency => 1,
:expiring_objects_account_name => 'expiring_objects',
@ -60,6 +60,8 @@ describe 'swift::objectexpirer' do
'object-expirer/log_level').with_value(p[:log_level])
is_expected.to contain_swift_object_expirer_config(
'object-expirer/log_facility').with_value(p[:log_facility])
is_expected.to contain_swift_object_expirer_config(
'filter:cache/memcache_servers').with_value(p[:memcache_servers])
end
it 'configures object-expirer service' do
@ -82,17 +84,16 @@ describe 'swift::objectexpirer' do
end
end
context 'when including cache in pipeline' do
context 'when cache is not included in pipeline' do
before do
params.merge!(
:pipeline => ['catch_errors', 'cache', 'proxy-server'],
:memcache_servers => ['127.0.0.1:11211'],
:pipeline => ['catch_errors', 'proxy-logging', 'proxy-server'],
)
end
it 'configures memcache servers' do
is_expected.to contain_swift_object_expirer_config(
'filter:cache/memcache_servers').with_value(p[:memcache_servers])
it 'should not configure memcache servers' do
is_expected.to_not contain_swift_object_expirer_config(
'filter:cache/memcache_servers')
end
end