Skip to content

Conversation

@y-rabie
Copy link
Contributor

@y-rabie y-rabie commented Oct 22, 2025

What type of PR is this?

fix: cleanup dangling parents in route and policies statuses

What this PR does / why we need it:

This is a re-iteration on my previous pr #6812. Changes in that pr was reverted later in #7068 because I didn't account for routes that have multiple parents of different gatewayclasses.

The code currently sends an incremental route status update for every gatewayclass it processes, not a full one of all gateways (of all gatewayclasses) the route is attached to.

This is resolved here for all kinds of routes and policies. The code now processes and accumulates the translation status results, then at the very end sends an atomic status update with all parents/ancestors status conditions.

Changes in #7068 are reverted back.

E2e tests have been added for same-gatewayclass parents and multi-gatewayclasses parents.

There's one more nit to go as I mentioned before, which is when a route reference one of our gateways, and then no longer reference us at all. It'll have its parent status dangling forever. I have the fix for that in progress but it's more involved, so for a later PR.

Which issue(s) this PR fixes:

Fixes #6933 #774 #656 #6125 #6175

Release Notes: Yes/No

@y-rabie y-rabie requested a review from a team as a code owner October 22, 2025 19:00
@y-rabie y-rabie changed the title fix: cleanup dangling parents in route and policies statuses fix: cleanup dangling parents in route and policy statuses Oct 22, 2025
@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 25.46584% with 240 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.10%. Comparing base (dade425) to head (4e4e846).

Files with missing lines Patch % Lines
internal/gatewayapi/runner/runner.go 0.00% 196 Missing ⚠️
internal/provider/kubernetes/status.go 33.33% 34 Missing ⚠️
internal/gatewayapi/extensionserverpolicy.go 80.00% 2 Missing and 4 partials ⚠️
internal/gatewayapi/envoyextensionpolicy.go 88.88% 1 Missing and 1 partial ⚠️
internal/gatewayapi/securitypolicy.go 88.88% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (25.46%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7307      +/-   ##
==========================================
- Coverage   72.39%   72.10%   -0.30%     
==========================================
  Files         231      231              
  Lines       34043    34234     +191     
==========================================
+ Hits        24647    24684      +37     
- Misses       7625     7770     +145     
- Partials     1771     1780       +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zhaohuabing
Copy link
Member

@y-rabie Looks like e2e tests are broken - can you fix it?

@y-rabie
Copy link
Contributor Author

y-rabie commented Oct 24, 2025

Yeah sure, I'll work on your comments then fix e2e tests

@y-rabie y-rabie force-pushed the fix-statuses-with-multiple-parents branch 4 times, most recently from d79bd54 to 0cdbd4b Compare October 28, 2025 15:13
@y-rabie
Copy link
Contributor Author

y-rabie commented Oct 28, 2025

/retest

@y-rabie y-rabie force-pushed the fix-statuses-with-multiple-parents branch from 0cdbd4b to e0fdedb Compare October 28, 2025 15:27
@y-rabie
Copy link
Contributor Author

y-rabie commented Oct 28, 2025

/retest

2 similar comments
@y-rabie
Copy link
Contributor Author

y-rabie commented Oct 28, 2025

/retest

@y-rabie
Copy link
Contributor Author

y-rabie commented Oct 28, 2025

/retest

@y-rabie
Copy link
Contributor Author

y-rabie commented Oct 28, 2025

@zhaohuabing Appreciate you taking a look again when you can!

@zhaohuabing zhaohuabing force-pushed the fix-statuses-with-multiple-parents branch from e0fdedb to 4b27182 Compare October 29, 2025 10:39
@zhaohuabing
Copy link
Member

zhaohuabing commented Nov 4, 2025

Hi @y-rabie I haven't forgotten about this PR :-)

I've been working on v1.6 and some other tasks, but now I'll have some time to review it.

In the meantime, could you please resolve the conflicts?

@y-rabie y-rabie force-pushed the fix-statuses-with-multiple-parents branch 3 times, most recently from caf36ac to 3de6775 Compare November 4, 2025 18:58
@y-rabie y-rabie force-pushed the fix-statuses-with-multiple-parents branch 2 times, most recently from a47a53c to 4f23d53 Compare November 5, 2025 21:48
@zhaohuabing zhaohuabing force-pushed the fix-statuses-with-multiple-parents branch from 4f23d53 to 4e4e846 Compare November 6, 2025 06:26
@zhaohuabing zhaohuabing requested review from a team and arkodg November 6, 2025 06:32
Namespace: namespace,
Name: string(p.Name),
}
if _, ok := gatewayMap[gwNN]; ok && (p.Kind == nil || *p.Kind == resource.KindGateway) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for fixing this!

},
},
{
ControllerName: "gateway.envoyproxy.io/gatewayclass-controller",
Copy link
Member

@zhaohuabing zhaohuabing Nov 6, 2025

Choose a reason for hiding this comment

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

@arkodg This status has been removed because this PR merge the status across multiple translation and update it only once at the end with the combined result.

Copy link
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

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.

HTTPRoute status updater does not remove non-targeted Gateway

2 participants