Skip to content
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

BGPFilter: Add prefixLength to BGPFilter to match on min/max prefix length #9114

Merged

Conversation

mstansberry
Copy link
Contributor

@mstansberry mstansberry commented Aug 8, 2024

Description

  • Add prefixLength to BGPFilter struct for more granular matching
  • Allows for advertisement of more or less specific addresses from a calico prefix without needing to accept or reject all
  • Tested locally in kind as well as unit tests

Related issues/PRs

fixes #8376
documents tigera/docs#1592

Todos

  • Tests
  • Documentation
  • Release note

Release Note

BGPFilter: Add prefix length matching

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@mstansberry mstansberry requested a review from a team as a code owner August 8, 2024 22:48
@marvin-tigera marvin-tigera added this to the Calico v3.29.0 milestone Aug 8, 2024
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Aug 8, 2024
@mstansberry mstansberry changed the title BGPFilter: Add prefixLength to BGPFilter to match on prefix length BGPFilter: Add prefixLength to BGPFilter to match on min/max prefix length Aug 8, 2024
@caseydavenport caseydavenport self-assigned this Aug 8, 2024
Copy link

@bsalmicw bsalmicw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore me, not an approver for project calico

Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up @mstansberry !

It's looking pretty good - most of my comments are just API conventions type stuff to make sure we have the right optionality set, and to ensure users can't provide invalid input on the API.

api/pkg/apis/projectcalico/v3/bgpfilter.go Outdated Show resolved Hide resolved
api/pkg/apis/projectcalico/v3/bgpfilter.go Outdated Show resolved Hide resolved
confd/pkg/resource/template/template_funcs.go Outdated Show resolved Hide resolved
confd/pkg/resource/template/template_funcs_test.go Outdated Show resolved Hide resolved
@mstansberry
Copy link
Contributor Author

Just following up to see if there are any additional changes to make here? Thanks a lot.

@caseydavenport
Copy link
Member

/sem-approve

…ength

BGPFilter: Update PrefixLength to use pointers, add validators, and move to int32
BGPFilter: Update BGPFilter tests to duplicate and only use ipv6 in v6 rules
BGPFilter: Add test confirming prefixLength is ignored when CIDR is not provided
BGPFilter: Add error surfacing for failed ParseCIDR
BGPFilter: Add kubebuilder validation for PrefixLength
BGPFilter: Flatten validator functions for PrefixLength and add checks for empty CIDR
@marvin-tigera
Copy link
Contributor

Removing "merge-when-ready" label due to new commits

@mstansberry
Copy link
Contributor Author

squashed based on the label applied, looks like that might have been the wrong move

@caseydavenport
Copy link
Member

@mstansberry whoops! Sorry, that label is for the bot

@caseydavenport
Copy link
Member

/sem-approve

@caseydavenport
Copy link
Member

Just allows me to run CI, apply the label, and the bot will merge once it passes

@caseydavenport caseydavenport merged commit 3bca322 into projectcalico:master Aug 19, 2024
1 of 2 checks passed
@mstansberry mstansberry deleted the route_filter_prefix branch August 19, 2024 20:49
@caseydavenport caseydavenport added the docs-completed Docs PR has been merged for this change label Oct 28, 2024
@marvin-tigera marvin-tigera removed the docs-pr-required Change is not yet documented label Oct 28, 2024
@caseydavenport caseydavenport removed the docs-pr-required Change is not yet documented label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-completed Docs PR has been merged for this change merge-when-ready release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BGPFilter: match on prefix length
4 participants