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(log): do not log errors when parentRef kind is not Gateway #6692

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

randmonkey
Copy link
Contributor

@randmonkey randmonkey commented Nov 19, 2024

What this PR does / why we need it:

Do not log errors when a parentRef item is not referencing a Gateway. It is possibly that the route is managed by some other controllers, like using service mesh.

Which issue this PR fixes:

fixes #6584
Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@randmonkey randmonkey self-assigned this Nov 19, 2024
@randmonkey randmonkey requested a review from a team as a code owner November 19, 2024 03:44
@randmonkey randmonkey force-pushed the fix/do_not_log_unsupported_parentRef_kind branch from f83d49f to c8af668 Compare November 19, 2024 03:51
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.9%. Comparing base (61a1f60) to head (c8af668).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #6692     +/-   ##
=======================================
+ Coverage   77.7%   77.9%   +0.1%     
=======================================
  Files        203     203             
  Lines      23836   23832      -4     
=======================================
+ Hits       18534   18570     +36     
+ Misses      4351    4315     -36     
+ Partials     951     947      -4     

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


🚨 Try these New Features:

Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

Given that this became a problem how about adding a UT for IsRouteAttachedToReconciledGateway()? This func is used across the code base in several place so IMHO it would be worth adding tests for it. WDYT?

internal/controllers/gateway/route_predicates.go Outdated Show resolved Hide resolved
@randmonkey randmonkey force-pushed the fix/do_not_log_unsupported_parentRef_kind branch from c8af668 to 1a0fb69 Compare November 20, 2024 07:51
@pull-request-size pull-request-size bot added size/L and removed size/S labels Nov 20, 2024
@randmonkey randmonkey closed this Nov 20, 2024
@randmonkey randmonkey reopened this Nov 20, 2024
@randmonkey randmonkey force-pushed the fix/do_not_log_unsupported_parentRef_kind branch from 1a0fb69 to 8c0b6c1 Compare November 20, 2024 09:43
@randmonkey
Copy link
Contributor Author

Given that this became a problem how about adding a UT for IsRouteAttachedToReconciledGateway()? This func is used across the code base in several place so IMHO it would be worth adding tests for it. WDYT?

Added unit tests.

pmalek
pmalek previously approved these changes Nov 20, 2024
internal/controllers/gateway/route_predicate_test.go Outdated Show resolved Hide resolved
@randmonkey randmonkey merged commit 4c4cd89 into main Nov 20, 2024
40 checks passed
@randmonkey randmonkey deleted the fix/do_not_log_unsupported_parentRef_kind branch November 20, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants