-
Notifications
You must be signed in to change notification settings - Fork 94
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
Apply configuration of SnippetsFilters to NGINX #2604
base: feature/snippets-filter
Are you sure you want to change the base?
Apply configuration of SnippetsFilters to NGINX #2604
Conversation
I'm looking into the unit test failure. It's another data race 😭 |
g.Expect(servers[i].Includes).To(BeEmpty()) | ||
} else { | ||
g.Expect(server.Includes).To(ConsistOf(servers[i].Includes)) | ||
g.Expect(server.Locations).To(HaveLen(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It checks the length of locations before indexing into the location in the next line. If we don't check that the length is one, and then try to access the 0
th element, the test will panic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kate-osborn Sorry maybe I should have been a little more clear, how come the check is on the expServers
's server
instead of the servers
Location length?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Nice catch. Should be servers[i]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should also switch the expected and actual in the next assertion
Proposed changes
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.
Documentation will be added in a separate PR and is tracked by #2377.
Testing:
Closes #2417
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.