-
Notifications
You must be signed in to change notification settings - Fork 392
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: store one copy of HTTPRoute Extension Filters #5002
Conversation
6073b77
to
7d004b3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5002 +/- ##
==========================================
+ Coverage 66.77% 66.82% +0.04%
==========================================
Files 209 209
Lines 32101 32100 -1
==========================================
+ Hits 21437 21451 +14
+ Misses 9381 9368 -13
+ Partials 1283 1281 -2 ☔ View full report in Codecov by Sentry. |
@@ -64,32 +64,36 @@ type resourceMappings struct { | |||
// httpRouteFilters is a map of HTTPRouteFilters, where the key is the namespaced name, | |||
// group and kind of the HTTPFilter. | |||
httpRouteFilters map[utils.NamespacedNameWithGroupKind]*egv1a1.HTTPRouteFilter |
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.
can this be removed ?
release-notes/current.yaml
Outdated
@@ -21,6 +21,7 @@ new features: | | |||
# Fixes for bugs identified in previous versions. | |||
bug fixes: | | |||
Fixed a nil pointer error that occurs when a SecurityPolicy refers to a UDS backend | |||
Fixed validation failure when multiple HTTPRoutes refer to the same extension filter |
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.
Fixed validation failure when multiple HTTPRoutes refer to the same extension filter | |
Fixed a validation failure when multiple HTTPRoutes refer to the same extension filter |
@@ -416,12 +404,13 @@ func (r *gatewayAPIReconciler) processHTTPRoutes(ctx context.Context, gatewayNam | |||
|
|||
switch string(filter.ExtensionRef.Kind) { | |||
case egv1a1.KindHTTPRouteFilter: | |||
httpFilter, ok := resourceMap.httpRouteFilters[key] | |||
if !ok { | |||
httpFilter, err := r.getHTTPRouteFilter(ctx, key.Name, key.Namespace) |
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.
lets wrap this inside if r.hrfCRDExists {
?
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 !
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
6729ae9
to
eb9b2db
Compare
* fix: store one copy of HTTPRoute Extension Filters Signed-off-by: Guy Daich <guy.daich@sap.com> * fix code review comments Signed-off-by: Guy Daich <guy.daich@sap.com> * check if httproutefilter crd exists Signed-off-by: Guy Daich <guy.daich@sap.com> --------- Signed-off-by: Guy Daich <guy.daich@sap.com> (cherry picked from commit 2a5ecaf) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
* fix: nil pointer error (#5000) * fix: nil pointer error Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> (cherry picked from commit 10a31f1) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix: store one copy of HTTPRoute Extension Filters (#5002) * fix: store one copy of HTTPRoute Extension Filters Signed-off-by: Guy Daich <guy.daich@sap.com> * fix code review comments Signed-off-by: Guy Daich <guy.daich@sap.com> * check if httproutefilter crd exists Signed-off-by: Guy Daich <guy.daich@sap.com> --------- Signed-off-by: Guy Daich <guy.daich@sap.com> (cherry picked from commit 2a5ecaf) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix: enable ipv4 compat mode for dual stack cluster support (#5018) enable ipv4 compat mode for dual stack cluster support Signed-off-by: Will Tekulve <tekulve.will@gmail.com> (cherry picked from commit e028254) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix: explicitly set ip family and family policy in gateway spec (#5019) * explicitly set ip family and family policy Signed-off-by: Will Tekulve <tekulve.will@gmail.com> * add TestService cases Signed-off-by: Will Tekulve <tekulve.will@gmail.com> (cherry picked from commit 4d5d3f0) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix: check before setting cookie TTL in sessionPersistence (#5026) * Check before setting Cookie TTL in Session Persistence Fixes a null ptr exception when the cookie ttl is nil but was being accessed without checking if its valid or not Signed-off-by: Arko Dasgupta <arko@tetrate.io> * simplify logic Signed-off-by: Arko Dasgupta <arko@tetrate.io> (cherry picked from commit dff0531) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix: dont shift listener ports for Standalone mode (#5027) * fix: dont shift listener ports for Standalone mode Fixes: #4981 Signed-off-by: Arko Dasgupta <arko@tetrate.io> * test Signed-off-by: Arko Dasgupta <arko@tetrate.io> * fix lint Signed-off-by: Arko Dasgupta <arko@tetrate.io> --------- Signed-off-by: Arko Dasgupta <arko@tetrate.io> (cherry picked from commit 84f2ad2) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix: shutdown-manager not respecting security context of container spec (#4938) * Fix shutdown-manager not respecting security context of container spec Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com> * Update securityContext testdata Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com> * Lint with gci Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com> --------- Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com> (cherry picked from commit 43621b4) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix: use tls config from BTP when connecting to the OIDC provider's well-known endpoint. (#4857) * add e2e test for OIDC provider with TLS Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * delete file Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix lint Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * use TLS config from BTLPolicy to fetch auth endpoint Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * refactor Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * update release note Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * update release note Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix test Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix test Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix test Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix test Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix test Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> * fix lint Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> --------- Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com> (cherry picked from commit 3a39c35) Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> --------- Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com> Signed-off-by: Guy Daich <guy.daich@sap.com> Signed-off-by: Will Tekulve <tekulve.will@gmail.com> Signed-off-by: Arko Dasgupta <arko@tetrate.io> Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com> Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com> Co-authored-by: Guy Daich <guy.daich@sap.com> Co-authored-by: Will Tekulve <tekulvw@users.noreply.github.com> Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com> Co-authored-by: Dean Coakley <dean.s.coakley@gmail.com>
What type of PR is this?
What this PR does / why we need it:
Currently, EG accumulates multiple copies of extension filters (one for each reference). As a result, multiple matching filters can be found when processing routes, leading to the reported issue.
Which issue(s) this PR fixes:
Fixes #4989
Release Notes: Yes