Fix the outdated parameter to define maximum zone name length
The max_domain_name_len parameter was renamed to the max_zone_name_len parameter[1]. This patch fixes the outdated parameter. Note that this change directly invalidate the old parameter instead of using its value to set the correct parameter, because the parameter has been broken for a long time. [1] c5949ccb2825128dc3f9c51cc333407246cf12a9 Change-Id: I47545c0d58e7c904ce51278c7bf9e26ab5af406b
This commit is contained in:
@@ -28,14 +28,14 @@
|
||||
# (optional) Tenant ID to own all managed resources - like auto-created records etc.
|
||||
# Defaults to '123456'
|
||||
#
|
||||
# [*max_domain_name_len*]
|
||||
# (optional) Maximum domain name length.
|
||||
# Defaults to 255
|
||||
# [*max_zone_name_len*]
|
||||
# (optional) Maximum zone name length.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*max_recordset_name_len*]
|
||||
# (optional) Maximum record name length.
|
||||
# warning('The max_record_name_len parameter is deprecated, use max_recordset_name_len instead.')
|
||||
# Defaults to 255
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*min_ttl*]
|
||||
# (optional) Minimum TTL.
|
||||
@@ -53,6 +53,12 @@
|
||||
# (optional) The name of the default pool.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*max_domain_name_len*]
|
||||
# (optional) Maximum domain name length.
|
||||
# Defaults to undef
|
||||
#
|
||||
class designate::central (
|
||||
$package_ensure = present,
|
||||
$central_package_name = $::designate::params::central_package_name,
|
||||
@@ -60,12 +66,14 @@ class designate::central (
|
||||
$service_ensure = 'running',
|
||||
$managed_resource_email = 'hostmaster@example.com',
|
||||
$managed_resource_tenant_id = '123456',
|
||||
$max_domain_name_len = '255',
|
||||
$max_recordset_name_len = '255',
|
||||
$max_zone_name_len = $::os_service_default,
|
||||
$max_recordset_name_len = $::os_service_default,
|
||||
$min_ttl = $::os_service_default,
|
||||
$workers = $::os_workers,
|
||||
$threads = $::os_service_default,
|
||||
$default_pool_id = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$max_domain_name_len = undef
|
||||
) inherits designate {
|
||||
|
||||
include designate::deps
|
||||
@@ -74,7 +82,7 @@ class designate::central (
|
||||
designate_config {
|
||||
'service:central/managed_resource_email' : value => $managed_resource_email;
|
||||
'service:central/managed_resource_tenant_id' : value => $managed_resource_tenant_id;
|
||||
'service:central/max_domain_name_len' : value => $max_domain_name_len;
|
||||
'service:central/max_zone_name_len' : value => $max_zone_name_len;
|
||||
'service:central/max_recordset_name_len' : value => $max_recordset_name_len;
|
||||
'service:central/min_ttl' : value => $min_ttl;
|
||||
'service:central/workers' : value => $workers;
|
||||
@@ -82,6 +90,12 @@ class designate::central (
|
||||
'service:central/default_pool_id' : value => $default_pool_id;
|
||||
}
|
||||
|
||||
# TODO(tkajinam): Remove this when the max_domain_name_len parameter
|
||||
# is removed
|
||||
designate_config {
|
||||
'service:central/max_domain_name_len' : ensure => absent;
|
||||
}
|
||||
|
||||
designate::generic_service { 'central':
|
||||
enabled => $enabled,
|
||||
manage_service => $service_ensure,
|
||||
|
@@ -0,0 +1,12 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``designate::central::max_zone_name_len`` parameter has been added
|
||||
to set the maximum zone name length.
|
||||
|
||||
deprecations:
|
||||
- |
|
||||
The ``designate::central::max_domain_name_len`` parameter has been
|
||||
deprecated and has no effect now. This parameter doesn't work as intended
|
||||
since the corresponding parameter was renamed in Designate. Use the
|
||||
``designate::central::max_zone_name_len`` parameter instead.
|
@@ -33,14 +33,27 @@ describe 'designate::central' do
|
||||
it 'configures designate-central with default parameters' do
|
||||
is_expected.to contain_designate_config('service:central/managed_resource_email').with_value('hostmaster@example.com')
|
||||
is_expected.to contain_designate_config('service:central/managed_resource_tenant_id').with_value('123456')
|
||||
is_expected.to contain_designate_config('service:central/max_domain_name_len').with_value('255')
|
||||
is_expected.to contain_designate_config('service:central/max_recordset_name_len').with_value('255')
|
||||
is_expected.to contain_designate_config('service:central/max_zone_name_len').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:central/max_recordset_name_len').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:central/min_ttl').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:central/workers').with_value(8)
|
||||
is_expected.to contain_designate_config('service:central/threads').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:central/default_pool_id').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with parameters overridden' do
|
||||
before do
|
||||
params.merge!({
|
||||
:max_zone_name_len => 100,
|
||||
:max_recordset_name_len => 200,
|
||||
})
|
||||
end
|
||||
|
||||
it 'configures the values set' do
|
||||
is_expected.to contain_designate_config('service:central/max_zone_name_len').with_value(100)
|
||||
is_expected.to contain_designate_config('service:central/max_recordset_name_len').with_value(200)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with custom package name' do
|
||||
|
Reference in New Issue
Block a user