-
Notifications
You must be signed in to change notification settings - Fork 437
firewall: T8761: Reintroduce VRF-interface names in generated config #5167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rolling
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,6 +171,26 @@ def get_config(config=None): | |
| if 'static_arp' in bond: | ||
| set_dependents('static_arp', conf) | ||
|
|
||
| # Check vrf membership, to ensure firewall is updated | ||
| # Parent interface | ||
| if is_node_changed(conf, base + [ifname, 'vrf']): | ||
| bond.update({'vrf_changed': {}}) | ||
| set_dependents('firewall', conf) | ||
|
davi2367 marked this conversation as resolved.
|
||
| # vif interface | ||
| for vif in conf.list_nodes(base + [ifname, 'vif']): | ||
| if is_node_changed(conf, base + [ifname, 'vif', vif, 'vrf']): | ||
| bond.update({'vrf_changed': {}}) | ||
| set_dependents('firewall', conf) | ||
| # q-in-q interface | ||
| for vif_s in conf.list_nodes(base + [ifname, 'vif-s']): | ||
| if is_node_changed(conf, base + [ifname, 'vif-s', vif_s, 'vrf']): | ||
| bond.update({'vrf_changed': {}}) | ||
| set_dependents('firewall', conf) | ||
| for vif_c in conf.list_nodes(base + [ifname, 'vif-s', vif_s, 'vif-c']): | ||
| if is_node_changed(conf, base + [ifname, 'vif-s', vif_s, 'vif-c', vif_c, 'vrf']): | ||
| bond.update({'vrf_changed': {}}) | ||
| set_dependents('firewall', conf) | ||
|
coderabbitai[bot] marked this conversation as resolved.
Comment on lines
+174
to
+192
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realise this is likely a bit of pain, but Ideally for code like this duplicated across majority of interface conf scripts, a single function in |
||
|
|
||
| bond['vpp_ifaces'] = cli_ifaces_list(conf) | ||
|
|
||
| return bond | ||
|
|
@@ -298,7 +318,11 @@ def apply(bond): | |
| else: | ||
| b.update(bond) | ||
|
|
||
| if dict_search('member.interface_remove', bond) or 'static_arp' in bond: | ||
| if ( | ||
| dict_search('member.interface_remove', bond) | ||
| or 'static_arp' in bond | ||
| or 'vrf_changed' in bond | ||
| ): | ||
| try: | ||
| call_dependents() | ||
| except ConfigError: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.