-
Notifications
You must be signed in to change notification settings - Fork 360
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
feat(translator): support disabling X-RateLimit headers #3397
Conversation
for my personal, API > Annotaions > Env flags. |
33a2f87
to
f9e4d4e
Compare
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit | ||
domain: first-listener | ||
rateLimitService: |
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.
compare this to:
gateway/internal/xds/translator/testdata/out/xds-ir/ratelimit.listeners.yaml
Lines 17 to 26 in 329aafc
- name: envoy.filters.http.ratelimit | |
typedConfig: | |
'@type': type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit | |
domain: first-listener | |
enableXRatelimitHeaders: DRAFT_VERSION_03 | |
rateLimitService: | |
grpcService: | |
envoyGrpc: | |
clusterName: ratelimit_cluster | |
transportApiVersion: V3 |
the config headers.disableRateLimitHeaders: true
causes the line
enableXRatelimitHeaders: DRAFT_VERSION_03
to be omitted, because OFF is the zero value and marshalling is configured as omitempty
hey @evacchi thanks for updating the PR with the API change, added some minor comments |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3397 +/- ##
==========================================
+ Coverage 67.77% 67.81% +0.03%
==========================================
Files 166 166
Lines 20037 20041 +4
==========================================
+ Hits 13581 13591 +10
+ Misses 5466 5461 -5
+ Partials 990 989 -1 ☔ View full report in Codecov by Sentry. |
8423b3c
to
5d23885
Compare
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.
LGTM thanks !
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.
Should we add an E2E to the RL suite for this case?
internal/gatewayapi/testdata/clienttrafficpolicy-ratelimitheaders.out.yaml
Show resolved
Hide resolved
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
5d23885
to
d792c7c
Compare
Attempting to add an e2e test, I think it should be correct but I do appreciate another set of eyes (also I am having some trouble with my local dev setup, so I'll have to figure that out...) |
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.
LGTM
Signed-off-by: Edoardo Vacchi evacchi@users.noreply.github.com
What this PR does / why we need it:
This PR exposes
EnableXRatelimitHeaders
as a Gateway flag. For backwards compatibility, it flips the semantics (Disable
vsEnable
) as to preserve the current default semantics, i.e. always emit.