[docker-fpm-frr]: Add unified-split mode to routing config (#11938)

- Why I did it
The values for config_db "docker_routing_config_mode" are:

separated: FRR config generated from ConfigDB, each FRR daemon has its own config file
unified: FRR config generated from ConfigDB, single FRR config file
split: FRR config not generated from ConfigDB, each FRR daemon has its own config file
This commit adds:
split-unified: FRR config not generated from ConfigDB, single FRR config file

- How I did it
In docker_init.sh, when split-unified is used, the FRR configs are not generated
from ConfigDB. What's more, "service integrated-vtysh-config" is configured in vtysh.conf.

- How to verify it
FRR config not overwritten when FRR container starts.

Signed-off-by: Arnaud le Taillanter <a.letaillanter@criteo.com>
This commit is contained in:
Arnaud 2022-11-14 19:37:48 +01:00 committed by GitHub
parent bd348c5264
commit 9d3814045b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -69,6 +69,9 @@ if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then
elif [ "$CONFIG_TYPE" == "split" ]; then elif [ "$CONFIG_TYPE" == "split" ]; then
echo "no service integrated-vtysh-config" > /etc/frr/vtysh.conf echo "no service integrated-vtysh-config" > /etc/frr/vtysh.conf
rm -f /etc/frr/frr.conf rm -f /etc/frr/frr.conf
elif [ "$CONFIG_TYPE" == "split-unified" ]; then
echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf
elif [ "$CONFIG_TYPE" == "unified" ]; then elif [ "$CONFIG_TYPE" == "unified" ]; then
CFGGEN_PARAMS=" \ CFGGEN_PARAMS=" \
-d \ -d \

View File

@ -152,7 +152,7 @@ stderr_logfile=syslog
dependent_startup=true dependent_startup=true
dependent_startup_wait_for=bgpd:running dependent_startup_wait_for=bgpd:running
{% if DEVICE_METADATA.localhost.docker_routing_config_mode is defined and DEVICE_METADATA.localhost.docker_routing_config_mode == "unified" %} {% if DEVICE_METADATA.localhost.docker_routing_config_mode is defined and (DEVICE_METADATA.localhost.docker_routing_config_mode == "unified" or DEVICE_METADATA.localhost.docker_routing_config_mode == "split-unified") %}
[program:vtysh_b] [program:vtysh_b]
command=/usr/bin/vtysh -b command=/usr/bin/vtysh -b
priority=6 priority=6

View File

@ -49,8 +49,13 @@ module sonic-device_metadata {
} }
leaf docker_routing_config_mode { leaf docker_routing_config_mode {
description "This leaf allows different configuration modes for FRR:
- separated: FRR config generated from ConfigDB, each FRR daemon has its own config file
- unified: FRR config generated from ConfigDB, single FRR config file
- split: FRR config not generated from ConfigDB, each FRR daemon has its own config file
- split-unified: FRR config not generated from ConfigDB, single FRR config file";
type string { type string {
pattern "unified|split|separated"; pattern "separated|unified|split|split-unified";
} }
default "unified"; default "unified";
} }