add BGP peer timer and BFD configuration support to BGPPolicy CRD#7844
Open
Denyme24 wants to merge 3 commits intoantrea-io:mainfrom
Open
add BGP peer timer and BFD configuration support to BGPPolicy CRD#7844Denyme24 wants to merge 3 commits intoantrea-io:mainfrom
BGPPolicy CRD#7844Denyme24 wants to merge 3 commits intoantrea-io:mainfrom
Conversation
…omponents Signed-off-by: Denyme24 <namanraj24@outlook.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the BGPPolicy CRD to support per-peer BGP timers (KEEPALIVE / Hold Time) and introduces a bfd configuration block in the API, with initial GoBGP timer mapping and accompanying tests/docs.
Changes:
- Add
keepaliveTimeSeconds,holdTimeSeconds, andbfdfields to theBGPPeerAPI types (plus deepcopy support). - Extend the
bgppolicyCRD OpenAPI schema and user documentation to describe / validate the new fields. - Map timer values into GoBGP
TimersConfigin the agent and add unit/integration test coverage for timer handling.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/apis/crd/v1alpha1/types.go | Adds BGPPeer timer fields and introduces BFDConfig / bfd API. |
| pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go | Adds deepcopy support for the new BGPPeer fields and BFDConfig. |
| build/charts/antrea/crds/bgppolicy.yaml | Updates the CRD schema to include timer and BFD fields. |
| pkg/agent/bgp/gobgp/gobgp.go | Maps the new timer fields into GoBGP peer configuration. |
| pkg/agent/bgp/gobgp/gobgp_test.go | Adds unit tests for timer-to-GoBGP conversion behavior. |
| pkg/agent/controller/bgp/controller_test.go | Adds integration-style test coverage for timer propagation through the controller. |
| docs/bgp-policy.md | Documents the new timer and BFD fields for users. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…BGPPolicy CRD; update related documentation and tests Signed-off-by: Denyme24 <namanraj24@outlook.com>
Signed-off-by: Denyme24 <namanraj24@outlook.com>
Contributor
Author
|
hey @antoninbas @petertran-avgo @luolanzone, would appreciate a review whenever you have a moment. Thank you. |
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.
fixes #7673
Summary
this PR adds support for configuring BGP peer timers (keepalive and hold time) and introduces BFD (Bidirectional Forwarding Detection) configuration fields in the
BGPPolicyCRD. These options allow more control over BGP session behavior and prepare the API for fast failure detection once GoBGP supports BFD.Changes
API Definition (
pkg/apis/crd/v1alpha1/types.go)KeepaliveTimeSeconds(int32, 1–65535) to configure the BGP KEEPALIVE intervalHoldTimeSeconds(int32, 0 or 3–65535) to configure the BGP hold timeout (0 disables it)BFDConfigstruct withEnabled,MinTransmitInterval,MinReceiveInterval, andMultiplierBFDpointer field to theBGPPeerstructCRD Schema (
build/charts/antrea/crds/bgppolicy.yaml)GoBGP Mapping (
pkg/agent/bgp/gobgp/gobgp.go)convertPeerConfigToGoBGPPeer()TimersConfigprotobuf fieldsDeep Copy (
pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go)KeepaliveTimeSeconds,HoldTimeSeconds, andBFDinBGPPeerBFDConfig.DeepCopyInto()andBFDConfig.DeepCopy()Tests
pkg/agent/bgp/gobgp/gobgp_test.goTestConvertPeerConfigToGoBGPPeerTimerswith multiple subtests covering different timer combinationspkg/agent/controller/bgp/controller_test.gogenerateBGPPeerWithTimers()helperTestBGPPolicyWithTimersintegration test covering Add and Update scenariosTest Results