-
Notifications
You must be signed in to change notification settings - Fork 115
Add SnippetsFilter API #2667
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
Add SnippetsFilter API #2667
Conversation
Problem: User wants to define a CRD for snippetsFilter to apply custom nginx configurations Solution: Defined a CRD for snippetsFilter
Problem: SnippetsFilters need to be in graph before we can write status to them. Solution: Register controller for SnippetsFilter when the flag --snippets-filter is set. Add SnippetsFilter to graph so we can write its status. Validate SnippetsFilter.
Add Status to SnippetsFilter Problem: Users want to be have information about the status of the snippetFilters. Solution: Add status details to snippetFilters.
Add controller to snippetsFilter status Problem: Users want to ensure controller name is added when condition is added to SnippetsFilter. Solution: Modify the SnippetsFilterStatus to include controller name writing status.
Problem: As a user of NGF, I want my SnippetsFilters configuration applied to NGF's data plane, so that I can leverage NGINX features not yet available in NGF. Solution: Apply configuration of valid SnippetsFilters referenced in HTTPRoutes and GRPCRoutes to the appropriate contexts in the NGINX config. If the SnippetsFilter referenced is invalid (wrong group or kind), the routing rule is not configured. If the SnippetsFilter cannot be resolved, the routing rule is configured, but the route will return a 500.
Problem: The main includes were defined twice, causing some issues in reloading nginx. Solution: Deduplicate the code.
add functional tests for snippetsFilter
✅ Deploy Preview will be available once build job completes!
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2667 +/- ##
==========================================
- Coverage 95.19% 88.89% -6.30%
==========================================
Files 1 110 +109
Lines 229 8556 +8327
Branches 50 50
==========================================
+ Hits 218 7606 +7388
- Misses 11 892 +881
- Partials 0 58 +58 ☔ View full report in Codecov by Sentry. |
@sjberman did you manually test that SnippetsFilters functionality still works properly after rebasing on main? |
@bjee19 No, the functional tests now exist that should verify that the nginx config is set properly from a snippets filter. |
Problem: As a user of NGF that has a need for an enhancement in the project, I want the ability to customize the NGINX configuration for NGF, So that I can utilize features that have not yet been exposed via configuration, Or so that I can work around a problem that has not yet been solved in NGF, but can be fixed through NGINX configuration. Solution: Add the new SnippetsFilter CRD to allow for injecting custom nginx configuration to a routing rule. Apply configuration of valid SnippetsFilters referenced in HTTPRoutes and GRPCRoutes to the appropriate contexts in the NGINX config. If the SnippetsFilter referenced is invalid (wrong group or kind), the routing rule is not configured. If the SnippetsFilter cannot be resolved, the routing rule is configured, but the route will return a 500. --------- Co-authored-by: salonichf5 <[email protected]> Co-authored-by: Kate Osborn <[email protected]>
Problem: As a user of NGF that has a need for an enhancement in the project, I want the ability to customize the NGINX configuration for NGF, So that I can utilize features that have not yet been exposed via configuration, Or so that I can work around a problem that has not yet been solved in NGF, but can be fixed through NGINX configuration.
Solution: Add the new SnippetsFilter CRD to allow for injecting custom nginx configuration to a routing rule. Apply configuration of valid SnippetsFilters referenced in HTTPRoutes and GRPCRoutes to the appropriate contexts in the NGINX config. If the SnippetsFilter referenced is invalid (wrong group or kind), the routing rule is not configured. If the SnippetsFilter cannot be resolved, the routing rule is configured, but the route will return a 500.
#703
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.