Merge "ovn: Accept arrays for ovn_*_connection parameters"

This commit is contained in:
Zuul 2022-06-20 18:52:50 +00:00 committed by Gerrit Code Review
commit 7685156256
2 changed files with 18 additions and 2 deletions

View File

@ -83,11 +83,11 @@ class octavia::provider::ovn (
# For now, the config below uses octavia_config until we can figure out how to pass extra
# configuration files to the api running as wsgi process.
octavia_config {
'ovn/ovn_nb_connection': value => $ovn_nb_connection;
'ovn/ovn_nb_connection': value => join(any2array($ovn_nb_connection), ',');
'ovn/ovn_nb_private_key': value => $ovn_nb_private_key;
'ovn/ovn_nb_certificate': value => $ovn_nb_certificate;
'ovn/ovn_nb_ca_cert': value => $ovn_nb_ca_cert;
'ovn/ovn_sb_connection': value => $ovn_sb_connection;
'ovn/ovn_sb_connection': value => join(any2array($ovn_sb_connection), ',');
'ovn/ovn_sb_private_key': value => $ovn_sb_private_key;
'ovn/ovn_sb_certificate': value => $ovn_sb_certificate;
'ovn/ovn_sb_ca_cert': value => $ovn_sb_ca_cert;

View File

@ -57,6 +57,22 @@ describe 'octavia::provider::ovn' do
it { is_expected.to contain_octavia_config('ovn/ovsdb_retry_max_interval').with_value(180) }
it { is_expected.to contain_octavia_config('ovn/ovsdb_probe_interval').with_value(60000) }
end
context 'with specific parameters' do
before do
params.merge!({
:ovn_nb_connection => ['tcp:192.0.2.11:6641', 'tcp:192.0.2.12:6641'],
:ovn_sb_connection => ['tcp:192.0.2.11:6642', 'tcp:192.0.2.12:6642'],
})
end
it { is_expected.to contain_octavia_config('ovn/ovn_nb_connection').with_value(
'tcp:192.0.2.11:6641,tcp:192.0.2.12:6641'
) }
it { is_expected.to contain_octavia_config('ovn/ovn_sb_connection').with_value(
'tcp:192.0.2.11:6642,tcp:192.0.2.12:6642'
) }
end
end
on_supported_os({