Add new update parameter: enable_ovn_match_northd.

This new boolean parameter enables update of the ovn-controllers after
ovn-northd. It tells the ovn-controller to not fetch new messages from
the ovn-northd until they are both the same version.

It's false by default so nothing changes.

Conflicts:
	manifests/controller.pp
	spec/classes/ovn_controller_spec.rb

Change-Id: I884a1bd836d21fba520bf5a6c17ff2bdc949e31f
(cherry picked from commit 392ad7946e)
This commit is contained in:
Sofer Athlan-Guyot 2020-11-24 02:42:30 +01:00 committed by Takashi Kajinami
parent d2c29451c4
commit f30b76a657
2 changed files with 17 additions and 1 deletions

View File

@ -66,6 +66,13 @@
# (optional) List of the transport zones to which the chassis belongs to.
# Defaults to empty list
#
# [*enable_ovn_match_northd*]
# (optional) When set to true, enable update of ovn_controller after
# ovn-northd by blocking new message from the ovn-northd to be
# accepted by the ovn_controller until they have the same version.
# This need >= ovn2.13-20.09.0-17.
# Default to false (keep the original behavior)
#
# [*ovn_chassis_mac_map*]
# (optional) A list or a hash of key-value pairs that map a chassis specific mac to
# a physical network name. An example value mapping two chassis macs to
@ -101,6 +108,7 @@ class ovn::controller(
$ovn_remote_probe_interval = 60000,
$ovn_openflow_probe_interval = 60,
$ovn_transport_zones = [],
$enable_ovn_match_northd = false,
$ovn_chassis_mac_map = [],
$ovn_monitor_all = false,
) {
@ -199,7 +207,10 @@ class ovn::controller(
$datapath_config = {}
}
create_resources('vs_config', merge($config_items, $chassis_mac_map, $bridge_items, $tz_items, $hw_offload, $datapath_config))
$ovn_match_northd = {
'external_ids:ovn-match-northd-version' => { 'value' => bool2str($enable_ovn_match_northd) }
}
create_resources('vs_config', merge($config_items, $chassis_mac_map, $bridge_items, $tz_items, $hw_offload, $datapath_config, $ovn_match_northd))
Service['openvswitch'] -> Vs_config<||> -> Service['controller']
if !empty($ovn_bridge_mappings) {

View File

@ -16,6 +16,7 @@ describe 'ovn::controller' do
:ovn_openflow_probe_interval => 8,
:ovn_monitor_all => true,
:ovn_transport_zones => ['tz1'],
:enable_ovn_match_northd => false,
:ovn_chassis_mac_map => ['physnet1:aa:bb:cc:dd:ee:ff',
'physnet2:bb:aa:cc:dd:ee:ff']
}
@ -85,6 +86,10 @@ describe 'ovn::controller' do
:value => params[:ovn_transport_zones],
)
is_expected.to contain_vs_config('external_ids:ovn-match-northd-version').with(
:value => params[:enable_ovn_match_northd],
)
is_expected.to contain_vs_config('external_ids:ovn-chassis-mac-mappings').with(
:value => 'physnet1:aa:bb:cc:dd:ee:ff,physnet2:bb:aa:cc:dd:ee:ff',
)