Add support for [storage] swift_container_prefix

Change-Id: I75db464e050d236baa38de396f5e1be90e9f3f58
This commit is contained in:
Takashi Kajinami 2024-08-23 16:42:49 +09:00
parent 4fab96113b
commit cf8053528a
3 changed files with 15 additions and 1 deletions

View File

@ -67,6 +67,10 @@
# (optional) Connection timeout in seconds. # (optional) Connection timeout in seconds.
# Defaults to $facts['os_service_default'] # Defaults to $facts['os_service_default']
# #
# [*swift_container_prefix*]
# (optional) Prefix to namespace metric containers.
# Defaults to $facts['os_service_default']
#
class gnocchi::storage::swift( class gnocchi::storage::swift(
$swift_auth_version = $facts['os_service_default'], $swift_auth_version = $facts['os_service_default'],
$swift_authurl = $facts['os_service_default'], $swift_authurl = $facts['os_service_default'],
@ -79,6 +83,7 @@ class gnocchi::storage::swift(
$swift_endpoint_type = $facts['os_service_default'], $swift_endpoint_type = $facts['os_service_default'],
$swift_service_type = $facts['os_service_default'], $swift_service_type = $facts['os_service_default'],
$swift_timeout = $facts['os_service_default'], $swift_timeout = $facts['os_service_default'],
$swift_container_prefix = $facts['os_service_default'],
) { ) {
include gnocchi::deps include gnocchi::deps
@ -96,6 +101,7 @@ class gnocchi::storage::swift(
'storage/swift_endpoint_type': value => $swift_endpoint_type; 'storage/swift_endpoint_type': value => $swift_endpoint_type;
'storage/swift_service_type': value => $swift_service_type; 'storage/swift_service_type': value => $swift_service_type;
'storage/swift_timeout': value => $swift_timeout; 'storage/swift_timeout': value => $swift_timeout;
'storage/swift_container_prefix': value => $swift_container_prefix;
} }
} }

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``gnocchi::storage::swift::swift_container_prefix`` prameter has
been added.

View File

@ -25,6 +25,7 @@ describe 'gnocchi::storage::swift' do
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('<SERVICE DEFAULT>') is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('<SERVICE DEFAULT>') is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value('<SERVICE DEFAULT>') is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_container_prefix').with_value('<SERVICE DEFAULT>')
end end
end end
@ -41,7 +42,8 @@ describe 'gnocchi::storage::swift' do
:swift_auth_version => 2, :swift_auth_version => 2,
:swift_endpoint_type => 'publicURL', :swift_endpoint_type => 'publicURL',
:swift_service_type => 'object-store', :swift_service_type => 'object-store',
:swift_timeout => 0 :swift_timeout => 0,
:swift_container_prefix => 'gnocchi',
}) })
end end
@ -58,6 +60,7 @@ describe 'gnocchi::storage::swift' do
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('publicURL') is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('publicURL')
is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('object-store') is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('object-store')
is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value(0) is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value(0)
is_expected.to contain_gnocchi_config('storage/swift_container_prefix').with_value('gnocchi')
end end
end end
end end