octavia-controller: Convert list values for ListOpts

The following parameters in octavia-controller are defined as ListOpt
which accept comma-separated list.
This change ensures that the corresponding parameters in puppet-octavia
accepts list values and convert these values to strings in the proper
format.
 - controller_worker/amp_secgroup_list
 - controller_worker/amp_boot_network_list
 - health_manager/controller_ip_port_list
 - amphora_agent/admin_log_targets
 - amphora_agent/tenant_log_targets

Change-Id: I6564e94550ea66f18fd99780a4c990fd18b4da4d
This commit is contained in:
Takashi Kajinami 2021-07-19 23:27:42 +09:00
parent a00e903ea8
commit f62f0b0e15
2 changed files with 13 additions and 13 deletions

View File

@ -34,7 +34,7 @@
#
# [*amp_boot_network_list*]
# List of networks to attach to Amphorae.
# Defaults to []
# Defaults to $::os_service_default
#
# [*loadbalancer_topology*]
# (optional) Load balancer topology configuration
@ -185,7 +185,7 @@ class octavia::controller (
$amp_image_tag = $::os_service_default,
$amp_image_owner_id = $::os_service_default,
$amp_secgroup_list = $::os_service_default,
$amp_boot_network_list = [],
$amp_boot_network_list = $::os_service_default,
$loadbalancer_topology = $::os_service_default,
$amphora_driver = $::os_service_default,
$compute_driver = $::os_service_default,
@ -241,8 +241,8 @@ class octavia::controller (
'controller_worker/amp_flavor_id' : value => $amp_flavor_id;
'controller_worker/amp_image_tag' : value => $amp_image_tag;
'controller_worker/amp_image_owner_id' : value => $amp_image_owner_id;
'controller_worker/amp_secgroup_list' : value => $amp_secgroup_list;
'controller_worker/amp_boot_network_list' : value => $amp_boot_network_list;
'controller_worker/amp_secgroup_list' : value => join(any2array($amp_secgroup_list), ',');
'controller_worker/amp_boot_network_list' : value => join(any2array($amp_boot_network_list), ',');
'controller_worker/loadbalancer_topology' : value => $loadbalancer_topology;
'controller_worker/amphora_driver' : value => $amphora_driver;
'controller_worker/compute_driver' : value => $compute_driver;
@ -253,17 +253,17 @@ class octavia::controller (
'haproxy_amphora/timeout_member_connect' : value => $timeout_member_connect;
'haproxy_amphora/timeout_member_data' : value => $timeout_member_data;
'haproxy_amphora/timeout_tcp_inspect' : value => $timeout_tcp_inspect;
'health_manager/controller_ip_port_list' : value => $controller_ip_port_list;
'health_manager/controller_ip_port_list' : value => join(any2array($controller_ip_port_list), ',');
'haproxy_amphora/connection_max_retries' : value => $connection_max_retries;
'haproxy_amphora/connection_retry_interval' : value => $connection_retry_interval;
'haproxy_amphora/connection_logging' : value => $connection_logging;
'haproxy_amphora/build_rate_limit' : value => $build_rate_limit;
'haproxy_amphora/build_active_retries' : value => $build_active_retries;
'networking/port_detach_timeout' : value => $port_detach_timeout;
'amphora_agent/admin_log_targets' : value => $admin_log_targets;
'amphora_agent/admin_log_targets' : value => join(any2array($admin_log_targets), ',');
'amphora_agent/administrative_log_facility' : value => $administrative_log_facility;
'amphora_agent/forward_all_logs' : value => $forward_all_logs;
'amphora_agent/tenant_log_targets' : value => $tenant_log_targets;
'amphora_agent/tenant_log_targets' : value => join(any2array($tenant_log_targets), ',');
'amphora_agent/user_log_facility' : value => $user_log_facility;
'haproxy_amphora/user_log_format' : value => $user_log_format;
'amphora_agent/disable_local_log_storage' : value => $disable_local_log_storage;

View File

@ -30,17 +30,17 @@ describe 'octavia::controller' do
:timeout_client_data => 60,
:timeout_member_connect => 5,
:timeout_member_data => 60,
:controller_ip_port_list => '1.2.3.4:5555,4.3.2.1:5555',
:controller_ip_port_list => ['1.2.3.4:5555', '4.3.2.1:5555'],
:connection_max_retries => 240,
:connection_retry_interval => 10,
:connection_logging => false,
:build_rate_limit => 10,
:build_active_retries => 5,
:port_detach_timeout => 15,
:admin_log_targets => '192.0.2.1:10514,2001:db8:1::10:10514',
:admin_log_targets => ['192.0.2.1:10514', '2001:db8:1::10:10514'],
:administrative_log_facility => 2,
:forward_all_logs => true,
:tenant_log_targets => '192.0.2.1:10514,2001:db8:1::10:10514',
:tenant_log_targets => ['192.0.2.1:10514', '2001:db8:1::10:10514'],
:user_log_facility => 3,
:user_log_format => '{{ project_id }} {{ lb_id }}',
:disable_local_log_storage => true,
@ -59,8 +59,8 @@ describe 'octavia::controller' do
is_expected.to contain_octavia_config('controller_worker/amp_flavor_id').with_value('42')
is_expected.to contain_octavia_config('controller_worker/amp_image_tag').with_value('amphorae1')
is_expected.to contain_octavia_config('controller_worker/amp_image_owner_id').with_value('customowner')
is_expected.to contain_octavia_config('controller_worker/amp_secgroup_list').with_value(['lb-mgmt-sec-grp'])
is_expected.to contain_octavia_config('controller_worker/amp_boot_network_list').with_value(['lbnet1', 'lbnet2'])
is_expected.to contain_octavia_config('controller_worker/amp_secgroup_list').with_value('lb-mgmt-sec-grp')
is_expected.to contain_octavia_config('controller_worker/amp_boot_network_list').with_value('lbnet1,lbnet2')
is_expected.to contain_octavia_config('controller_worker/loadbalancer_topology').with_value('SINGLE')
is_expected.to contain_octavia_config('controller_worker/amphora_driver').with_value('sample_amphora_driver')
is_expected.to contain_octavia_config('controller_worker/compute_driver').with_value('sample_compute_driver')
@ -101,7 +101,7 @@ describe 'octavia::controller' do
is_expected.to contain_octavia_config('controller_worker/amp_image_tag').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('controller_worker/amp_image_owner_id').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('controller_worker/amp_secgroup_list').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('controller_worker/amp_boot_network_list').with_value([])
is_expected.to contain_octavia_config('controller_worker/amp_boot_network_list').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('controller_worker/loadbalancer_topology').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('controller_worker/amphora_driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('controller_worker/compute_driver').with_value('<SERVICE DEFAULT>')