Add confd integration tests for BGPFilter#12142
Open
song-jiang wants to merge 2 commits intoprojectcalico:masterfrom
Open
Add confd integration tests for BGPFilter#12142song-jiang wants to merge 2 commits intoprojectcalico:masterfrom
song-jiang wants to merge 2 commits intoprojectcalico:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new confd test-suite coverage for additional BGPFilter match/operation combinations (communities, large communities, AS-path, priority, PeerType) and a KubeVirt live migration scenario, along with the corresponding expected compiled BIRD configs. Also refactors BGP filter BIRD function generation to reduce repeated import/export logic.
Changes:
- Add new
test_bgp_filterssub-tests covering communities+operations, peerType, AS path+priority, large communities, and a KubeVirt live-migration scenario. - Add expected compiled template outputs for the new bgpfilter scenarios.
- Refactor
BGPFilterBIRDFuncsgeneration logic to unify import/export processing and inline rule emission.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| confd/tests/test_suite_common.sh | Adds new bgpfilter-related test cases and wires them into the existing test_bgp_filters suite. |
| confd/pkg/resource/template/template_funcs.go | Refactors BGPFilter BIRD function generation to reduce duplication and centralize rule emission logic. |
| confd/tests/compiled_templates/bgpfilter/peer_type/bird.cfg | Adds expected BIRD v4 output for peerType rules test. |
| confd/tests/compiled_templates/bgpfilter/peer_type/bird6.cfg | Adds expected BIRD v6 output for peerType rules test. |
| confd/tests/compiled_templates/bgpfilter/peer_type/bird_aggr.cfg | Adds expected aggregation config for peerType scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/peer_type/bird6_aggr.cfg | Adds expected aggregation config for peerType scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/peer_type/bird_ipam.cfg | Adds expected IPAM config for peerType scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/peer_type/bird6_ipam.cfg | Adds expected IPAM config for peerType scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/large_community/bird.cfg | Adds expected BIRD v4 output for large-community matching/ops. |
| confd/tests/compiled_templates/bgpfilter/large_community/bird6.cfg | Adds expected BIRD v6 output for large-community matching/ops. |
| confd/tests/compiled_templates/bgpfilter/large_community/bird_aggr.cfg | Adds expected aggregation config for large-community scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/large_community/bird6_aggr.cfg | Adds expected aggregation config for large-community scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/large_community/bird_ipam.cfg | Adds expected IPAM config for large-community scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/large_community/bird6_ipam.cfg | Adds expected IPAM config for large-community scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird.cfg | Adds expected BIRD v4 output for standard communities + operations. |
| confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird6.cfg | Adds expected BIRD v6 output for standard communities + operations. |
| confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird_aggr.cfg | Adds expected aggregation config for communities+ops scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird6_aggr.cfg | Adds expected aggregation config for communities+ops scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird_ipam.cfg | Adds expected IPAM config for communities+ops scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/communities_and_operations/bird6_ipam.cfg | Adds expected IPAM config for communities+ops scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird.cfg | Adds expected BIRD v4 output for AS-path prefix + priority match/ops. |
| confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird6.cfg | Adds expected BIRD v6 output for AS-path prefix + priority match/ops. |
| confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird_aggr.cfg | Adds expected aggregation config for AS-path+priority scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird6_aggr.cfg | Adds expected aggregation config for AS-path+priority scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird_ipam.cfg | Adds expected IPAM config for AS-path+priority scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/as_path_and_priority/bird6_ipam.cfg | Adds expected IPAM config for AS-path+priority scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird.cfg | Adds expected BIRD v4 output for KubeVirt live-migration bgpfilter behavior. |
| confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird6.cfg | Adds expected BIRD v6 output for KubeVirt live-migration bgpfilter behavior. |
| confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird_aggr.cfg | Adds expected aggregation config for KubeVirt live-migration scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird6_aggr.cfg | Adds expected aggregation config for KubeVirt live-migration scenario (v6). |
| confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird_ipam.cfg | Adds expected IPAM config for KubeVirt live-migration scenario (v4). |
| confd/tests/compiled_templates/bgpfilter/kubevirt_live_migration/bird6_ipam.cfg | Adds expected IPAM config for KubeVirt live-migration scenario (v6). |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
aa4d551 to
2ba9e70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
communities + operations, kubevirt live migration, large communities, and peer type scenarios
BGPFilterBIRDFuncsdoc comment,inline
emitFilterRules, and deduplicate import/export logic with a direction loopRelease note: