Skip to content
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(translator): check for default FC existence before clearing it on… #5121

Merged
merged 5 commits into from
Jan 22, 2025

Conversation

guydc
Copy link
Contributor

@guydc guydc commented Jan 21, 2025

What type of PR is this?

What this PR does / why we need it:

  • Avoid nil pointer dereference of a listener's default filter chain when it's nil
  • Adds unit tests where translation fails and route cleanup is executed on a listener without a default filter chain

Which issue(s) this PR fixes:

Fixes #5119

Release Notes: No

… error

Signed-off-by: Guy Daich <guy.daich@sap.com>
@guydc guydc requested a review from a team as a code owner January 21, 2025 18:29
@guydc guydc requested review from liorokman and removed request for a team January 21, 2025 18:29
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 66.89%. Comparing base (dac5532) to head (73f5397).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/translator.go 33.33% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5121      +/-   ##
==========================================
- Coverage   66.89%   66.89%   -0.01%     
==========================================
  Files         210      210              
  Lines       32977    32978       +1     
==========================================
- Hits        22061    22059       -2     
  Misses       9583     9583              
- Partials     1333     1336       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@liorokman liorokman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guydc guydc force-pushed the fix-ext-clearroutes branch from f522406 to ac01f74 Compare January 21, 2025 23:48
Signed-off-by: Guy Daich <guy.daich@sap.com>
@guydc guydc force-pushed the fix-ext-clearroutes branch from ac01f74 to 90bfd37 Compare January 21, 2025 23:57
@arkodg arkodg added this to the v1.3.0 milestone Jan 21, 2025
@arkodg arkodg merged commit 7813ef0 into envoyproxy:main Jan 22, 2025
24 of 25 checks passed
DeeBi9 pushed a commit to DeeBi9/gateway that referenced this pull request Jan 25, 2025
envoyproxy#5121)

* fix(translator): check for default FC existence before clearing it on error

Signed-off-by: Guy Daich <guy.daich@sap.com>

* add unit test

Signed-off-by: Guy Daich <guy.daich@sap.com>

---------

Signed-off-by: Guy Daich <guy.daich@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic in xDS Translator
3 participants