Commit fb46784
NOS-6616..NOS-6642: fboss2 config/delete protocol bgp peer-group commands
Collapses the 18 per-attribute `config protocol bgp peer-group` command
classes (built on the deprecated `folly::dynamic` BgpConfigSession) into a
single typed dispatcher, mirroring CmdConfigProtocolBgpNeighbor. Also adds
`delete protocol bgp peer-group <name>`.
The group name is the first positional token; the next one or two tokens
name the attribute, matched longest-prefix-first so `timers hold-time` wins
over any `timers` prefix; the rest are its value(s). Handlers mutate the
typed bgp::thrift::PeerGroup through ConfigSession::getBgpConfig() /
saveBgpConfig(), so adding a tunable is a one-entry change in the dispatch
table rather than a new command class. 36 command files are deleted.
- Covers the 29 dispatch keys that map to a PeerGroup thrift field: remote-asn /
local-asn (4-byte-bounded), description, peer-tag, ingress-policy /
egress-policy, rr-client, confed-peer, redistribute-peer,
enhanced-route-refresh, connect-mode, add-path send|receive, afi
disable-ipv4-afi|disable-ipv6-afi|ipv4-over-ipv6-nh, graceful-restart
restart-time|stateful-ha, max-route pre-filter|post-filter (plus the
warning-threshold / warning-only knobs), timers
hold-time|keepalive|out-delay|withdraw-unprog-delay, and next-hop-self.
- Rejected rather than persisted as dead config (precedent: cluster-id in
the global command, connect-mode BOTH in the neighbor command):
connect-mode BOTH, since thrift only models is_passive. add-path
send|receive merges into the AddPath enum bitmask, and clearing the last
direction unsets the field.
- Attributes with no per-peer-group thrift field (afi
ipv4-labeled-unicast, afi ipv6-labeled-unicast, peer-port) are absent
from the dispatch table, so they are refused at parse time as unknown
attributes; a rejected value never lands on disk.
- positionals_at_end() stops parent-chain subcommand fallthrough from
reclassifying an attribute token that matches a sibling command name
once the group name has been consumed (same fix as the neighbor
command).
- unit tests (16): CmdConfigBgpPeerGroupTest (12) covering arg validation,
longest-prefix match, the add-path merge matrix, connect-mode, the
bool/string/route-limit attributes, value validation and unknown-attribute
rejection, plus CmdDeleteBgpPeerGroupTest (4).
- integration tests (3): ConfigBgpPeerGroupTest asserts the committed
peer_groups through bgpd's getRunningConfig RPC, proving the daemon
parsed and adopted the promoted config rather than only checking the
file the CLI wrote.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent c40cd77 commit fb46784
50 files changed
Lines changed: 1168 additions & 2227 deletions
File tree
- cmake
- fboss/cli/fboss2
- commands
- config/protocol/bgp/peer-group
- delete/protocol/bgp/peer-group
- test
- config
- integration_test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | 883 | | |
920 | 884 | | |
921 | 885 | | |
| |||
1012 | 976 | | |
1013 | 977 | | |
1014 | 978 | | |
| 979 | + | |
| 980 | + | |
1015 | 981 | | |
1016 | 982 | | |
1017 | 983 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | 1103 | | |
1122 | 1104 | | |
1123 | 1105 | | |
| |||
1166 | 1148 | | |
1167 | 1149 | | |
1168 | 1150 | | |
| 1151 | + | |
1169 | 1152 | | |
1170 | 1153 | | |
1171 | 1154 | | |
| |||
1224 | 1207 | | |
1225 | 1208 | | |
1226 | 1209 | | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | 1210 | | |
1242 | 1211 | | |
1243 | 1212 | | |
| |||
1287 | 1256 | | |
1288 | 1257 | | |
1289 | 1258 | | |
| 1259 | + | |
1290 | 1260 | | |
1291 | 1261 | | |
1292 | 1262 | | |
| |||
0 commit comments