-
Notifications
You must be signed in to change notification settings - Fork 363
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
fix: add unsupported status condition for filters within BackendRef #2620
fix: add unsupported status condition for filters within BackendRef #2620
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2620 +/- ##
==========================================
+ Coverage 63.00% 63.08% +0.07%
==========================================
Files 122 122
Lines 19770 19811 +41
==========================================
+ Hits 12457 12498 +41
Misses 6506 6506
Partials 807 807 ☔ View full report in Codecov by Sentry. |
/retest |
internal/gatewayapi/route.go
Outdated
@@ -173,6 +173,15 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe | |||
dstAddrTypeMap := make(map[ir.DestinationAddressType]int) | |||
|
|||
for _, backendRef := range rule.BackendRefs { | |||
if len(backendRef.Filters) > 0 { |
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 continue
, we have been failing fast and early in other places
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.
we could, let's fail fast then on this
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.
rethinking again, this code should live inside validateBackendRef which gets called here
gateway/internal/gatewayapi/route.go
Line 1080 in ac02437
if !t.validateBackendRef(&backendRef, parentRef, route, resources, backendNamespace, routeType) { |
which automatically converts the weight
into a invalidWeight
ensuring that a percentage of traffic gets 503'd
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.
looks good, but the field Filters is within gwapiv1.HTTPBackendRef or gwapiv1a1.GRPCBackendRef.
we process BackendRef based on gwapiv1.BackendRef
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.
we've had to do something similar for xRoutes, so we created RouteContext
gateway/internal/gatewayapi/contexts.go
Line 155 in cc88e9c
type RouteContext interface { |
may need something similar here
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.
if we want to extend it, then sure
thanks for explaining
/retest |
fae5f06
to
063d326
Compare
063d326
to
6a64316
Compare
5dfa61a
to
c76954d
Compare
/retest |
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 for incorporating the feedback
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
c76954d
to
d59e52e
Compare
sure, found the context in #1252 |
/retest |
/retest |
1 similar comment
/retest |
…nvoyproxy#2620) * add unsupported status condition for filters within BackendRef Signed-off-by: Karol Szwaj <[email protected]> * continue on unsupported backendref Signed-off-by: Karol Szwaj <[email protected]> * continue on unsupported backendref Signed-off-by: Karol Szwaj <[email protected]> * add BackendRefContext Signed-off-by: Karol Szwaj <[email protected]> * fix gosec lint Signed-off-by: Karol Szwaj <[email protected]> * clean up old funcs Signed-off-by: Karol Szwaj <[email protected]> * dedup code Signed-off-by: Karol Szwaj <[email protected]> * update old code Signed-off-by: Karol Szwaj <[email protected]> --------- Signed-off-by: Karol Szwaj <[email protected]> Signed-off-by: zirain <[email protected]>
…nvoyproxy#2620) * add unsupported status condition for filters within BackendRef Signed-off-by: Karol Szwaj <[email protected]> * continue on unsupported backendref Signed-off-by: Karol Szwaj <[email protected]> * continue on unsupported backendref Signed-off-by: Karol Szwaj <[email protected]> * add BackendRefContext Signed-off-by: Karol Szwaj <[email protected]> * fix gosec lint Signed-off-by: Karol Szwaj <[email protected]> * clean up old funcs Signed-off-by: Karol Szwaj <[email protected]> * dedup code Signed-off-by: Karol Szwaj <[email protected]> * update old code Signed-off-by: Karol Szwaj <[email protected]> --------- Signed-off-by: Karol Szwaj <[email protected]> Signed-off-by: zirain <[email protected]>
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes