fix: allow requests:0 for global rate limit block rules#9333
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9333 +/- ##
=======================================
Coverage 75.17% 75.17%
=======================================
Files 252 252
Lines 41049 41049
=======================================
Hits 30860 30860
+ Misses 8094 8093 -1
- Partials 2095 2096 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
9939f85 to
d8d1e37
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
For a global rate-limit rule,
limit.requests: 0now passes admission validation, since a zero global limit expresses a valid "block all matching traffic" rule. Local rate limits continue to reject zero. A release-note fragment is included underrelease-notes/current/bug_fixes.Why this matters
The CEL validation on
BackendTrafficPolicyrejectedrequests: 0for both local and global rate limits, but a zero global limit is the documented way to express a block-all rule. The validation now distinguishes the two cases so block rules are accepted while local zero limits stay rejected. Reported in #9273.Testing
Added a CEL-validation test asserting that a global rule with
requests: 0is accepted and that a local zero limit is still rejected. (The CEL test could not run in this environment because the envtest binaries are absent; the schema, generated CRD, and validation changes are self-consistent.)Fixes #9273