Skip to content

fix(translator): ignore http1 when checking merge eligibility of non-HTTP routes - #10421

Open
cvas22 wants to merge 3 commits into
envoyproxy:mainfrom
cvas22:fix/10307-http1-merge-eligibility
Open

cvas22 wants to merge 3 commits into
envoyproxy:mainfrom
cvas22:fix/10307-http1-merge-eligibility

Conversation

@cvas22

@cvas22 cvas22 commented Oct 27, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

With merge backends enabled, BuildBTPIndexes marks a route as cluster-affecting when a route-level BackendTrafficPolicy sets any cluster-scoped field, http1 included. For GRPCRoute, TCPRoute, TLSRoute and UDPRoute, translation ignores http1 and only warns about it (validateBackendTrafficPolicyForRoute). A StrategicMerge policy that sets only http1 on such a route still made routeDestinationForListener emit inline cluster settings instead of a BackendClusterRef. That demerged the backend, and could keep a valid Service-targeted BTP from applying.

I added btpSpecHasClusterScopedFieldsForRoute, which leaves http1 out of the check for those four route kinds, and use it for the route and route-rule entries of the cluster-settings index. Gateway, listener and ListenerSet targets, and HTTPRoute targets, behave as before.

Which issue(s) this PR fixes:
Fixes #10307

Notes:

I added TestBtpSpecHasClusterScopedFieldsForRoute and TestBTPClusterSettingsIndexIgnoresHTTP1OnGRPCRoute. They pass along with the existing TestBtpSpecHasClusterScopedFields* and TestBTPClusterSettingsIndex. I haven't run make lint or make gen-check locally.


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: N/A: no API changes.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • Docs: N/A: no user-facing configuration change.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.
  • Generated files committed: N/A: no API, helm or module changes.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

…HTTP routes

A BackendTrafficPolicy that sets only http1 on a GRPCRoute, TCPRoute,
TLSRoute or UDPRoute counted as cluster-affecting in the merge-backends
index, although translation ignores http1 for those routes. The route
then got inline cluster settings instead of a merged BackendClusterRef.
Leave http1 out of the check for those route kinds.

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@cvas22
cvas22 requested a review from a team as a code owner October 27, 2026 02:02
@netlify

netlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 9146e15
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ae0061a9da7f2f86e2f73aa
😎 Deploy Preview https://deploy-preview-10421--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T18:58:44.576829Z 3f77ed6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@netlify

netlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 3f77ed6
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6aee22308ce1404128892fb8
😎 Deploy Preview https://deploy-preview-10421--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zirain zirain added this to the v1.10.0 Release milestone Oct 27, 2026
@zirain

zirain commented Oct 27, 2026

Copy link
Copy Markdown
Member

cc @muwaqar

@muwaqar-cflt

Copy link
Copy Markdown
Contributor

cc @guydc

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.70%. Comparing base (3e91fbc) to head (3f77ed6).
⚠️ Report is 59 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10421      +/-   ##
==========================================
- Coverage   82.70%   82.70%   -0.01%     
==========================================
  Files         277      277              
  Lines       44451    44457       +6     
==========================================
+ Hits        36763    36767       +4     
- Misses       7687     7689       +2     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 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.

@cvas22

cvas22 commented Oct 27, 2026

Copy link
Copy Markdown
Author

/retest

@guydc

guydc commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Hi @cvas22 ! Thanks for picking this up. Implementation looks good to me.

I want to note that #10307 refers to a wider pattern. While the HTTP1 example was flagged in a previous review, there are additional BTP fields that may be excluded based on routes types. I updated the issue to reflect that more clearly.

It's fine to keep the PR scoped to HTTP1, and have the more conservative de-merge for other cases.

cc @muwaqar-cflt - WDYT about the following:

Route Kind Fields to exclude from merge-eligibility
GRPCRoute HTTP1, HTTP3
TCPRoute / TLSRoute HTTP1, HTTP2, HTTP3, UseClientProtocol, AdmissionControl
UDPRoute HTTP1, HTTP2, HTTP3, UseClientProtocol, AdmissionControl, ProxyProtocol, HealthCheck, CircuitBreaker, TCPKeepalive, Timeout, Connection

guydc
guydc previously approved these changes Oct 27, 2026
@muwaqar-cflt

muwaqar-cflt commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

IMHO this has the potential to quickly become non-maintainable with the code overriding what the user has supplied in the policy.

For the background, if these policies do not support the relevant fields, why not validate them before any processing is run? Either thru CEL or thru a controller (like how we added "Invalid" status for backend-BTP).

@guydc

guydc commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

It might be a bit nuanced for CEL. When targeting xRoutes, the validation is possible. For other targets, it gets complicated:

  • When targeting HTTPS Listeners, both GRPC and HTTP routes can attach later.
  • When targeting ListenerSets, various protocols can be supported in the set.

Controller validation is probably possible, but will perhaps be breaking for existing users.

I agree that this warrants further discussion on which approach to take - should policies be strictly validated for compatibility with all targets in scope, or translated in a best-effort sort of way. cc @envoyproxy/gateway-maintainers

@guydc
guydc dismissed their stale review October 27, 2026 13:19

Wait for a decision on wider policy strict validation topic

@cvas22

cvas22 commented Oct 27, 2026

Copy link
Copy Markdown
Author

Thanks @guydc and @muwaqar-cflt. I'll keep this PR scoped to http1 as suggested.

On the wider pattern: the translator already ignores these fields per route kind (validateBackendTrafficPolicyForRoute warns about them), so merge-eligibility should follow the same rules rather than keep a second copy. If the best-effort direction is chosen, I'd do the follow-up as one table keyed by route kind, like the one above. validateBackendTrafficPolicyForRoute and the merge-eligibility check would both read from it, so a field is listed once and the two can't drift apart. If you go with strict validation instead, the same table would drive the Invalid status for xRoute targets.

Happy to take either once you've settled on the approach.

@cvas22

cvas22 commented Oct 27, 2026

Copy link
Copy Markdown
Author

The remaining failure is TestE2E/BackendHealthCheckEventLog (health check events in logs), which this PR doesn't touch. The build_and_test workflow has also been failing on main since this morning.

…-eligibility

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@zhaohuabing

zhaohuabing commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Put up #10804 as a possible follow-up to use one function to decide which BTP fields reach which kind of cluster, and the merge check uses it. It goes with best-effort rather than strict validation, to avoid a breaking change. It covers http1 on GRPCRoute too, so the two overlap.

This branch has not been deployed

No deployments
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.

MergeBackends: hasClusterSettings may consider the xRoute type to allow further de-duping

5 participants