Repository navigation
fix(backendtrafficpolicy): isolate cluster-scoped settings from route-scoped field errors - #10234
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@zhaohuabing @zirain @guydc could one of you take a look when you have a chance? |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10234 +/- ##
==========================================
- Coverage 81.73% 81.71% -0.02%
==========================================
Files 267 267
Lines 42052 42058 +6
==========================================
- Hits 34370 34369 -1
- Misses 7681 7688 +7
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…-scoped field errors A BackendTrafficPolicy's cluster-scoped settings (circuit breaker, load balancer, timeout, etc.) failed to apply to a merged backend cluster whenever any route-scoped field (e.g. a broken rateLimit) failed to translate, even though the cluster-scoped fields themselves were valid. This affected both the whole-Gateway BTP path and the backend-targeted BTP merge path added in envoyproxy#9816. Extract buildClusterTrafficFeatures to build and error on only the cluster-scoped subset, and gate cluster application on that error instead of the combined one. Fixes envoyproxy#10210 Signed-off-by: Muhammad Waqar <[email protected]>
Signed-off-by: Muhammad Waqar <[email protected]>
9234fb2 to
bfe768e
Compare
Summary
Fixes #10210.
A
BackendTrafficPolicy's cluster-scoped settings (circuit breaker, load balancer, timeout, TCP keepalive, backend connection, HTTP2) failed to apply to a merged backend cluster whenever any route-scoped field on the policy failed to build (e.g. arateLimitreferencing a missing ratelimit service), even though the cluster-scoped fields were themselves perfectly valid.This affected two places:
translateBackendTrafficPolicyForListeners'sapplyToBackendClustersgate - a pre-existing gap, not introduced by feat(backendtrafficpolicy): support targeting Service, ServiceImport, or Backend directly (merged clusters only) #9816.processBackendTrafficPolicyForBackend(added in feat(backendtrafficpolicy): support targeting Service, ServiceImport, or Backend directly (merged clusters only) #9816) - a gateway-level policy's broken route-scoped field, merged in, could block an otherwise-valid backend-targeted policy's cluster-scoped settings from applying.Fix
ir.ClusterTrafficFeaturesalready documents the cluster (CDS)-scoped subset ofTrafficFeatures("route- and HCM-scoped features live onTrafficFeaturesinstead"), butbuildTrafficFeaturesjoined every field's build error into a single combined error, and both cluster-application call sites gated on that combined error.This PR extracts
buildClusterTrafficFeatures, which builds and errors on only the cluster-scoped subset.buildTrafficFeaturescomposes it (unchanged signature/behavior for every other caller - route application still intentionally fails closed with a 500 on any error, which is untouched). The two cluster-application call sites now gate on the cluster-scoped error instead of the combined one.applyGatewayPolicyToMergedCluster's parameter changes from*ir.TrafficFeaturesto*ir.ClusterTrafficFeatures, since it only ever read that subset.Test plan
go build ./...go test ./internal/...make generate manifests helm-template protos go.testdata.complete(no diff)golangci-lintoninternal/gatewayapi/...(clean)TestProcessBackendTrafficPolicyForBackendEdgeCasesand newTestTranslateBackendTrafficPolicyForListenersClusterErrorIsolation, both verified to fail against the pre-fix gating logic🤖 Generated with Claude Code