xds/resolver: pass route's auto_host_rewrite to LB picker (gRFC A81)
This PR implements the ConfigSelector changes required for gRFC A81.
It ensures that the auto_host_rewrite field from the xDS Route Configuration is correctly propagated through the resolver and made available to the Load Balancer picker via the RPC context.
Key Changes:
- Pass the
AutoHostRewritefield value fromRoutestruct via RPC context. - Add helper functions for
AutoHostRewriteininternal/xds/balancer/cluserimpl/picker.go. - Update
ConfigSelector.SelectConfigto pass theAutoHostRewriteboolean in RPC context.
RELEASE NOTES: None
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 83.47%. Comparing base (4c27cc8) to head (9cbcc98).
:warning: Report is 8 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #8740 +/- ##
==========================================
+ Coverage 83.28% 83.47% +0.18%
==========================================
Files 418 418
Lines 32367 32434 +67
==========================================
+ Hits 26958 27073 +115
+ Misses 4034 3991 -43
+ Partials 1375 1370 -5
| Files with missing lines | Coverage Δ | |
|---|---|---|
| internal/xds/balancer/clusterimpl/picker.go | 97.40% <100.00%> (+0.25%) |
:arrow_up: |
| internal/xds/resolver/serviceconfig.go | 88.05% <100.00%> (+0.08%) |
:arrow_up: |
| internal/xds/resolver/xds_resolver.go | 88.63% <100.00%> (+0.06%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Sorry for suggesting that we could possibly send the whole route instead of sending only the auto_host_rewrite field, as specified in A60. After reading A60, I realized that sending the whole route down is not as simple as just stashing a pointer to the route in an attribute. We need to take into account things like reference counts to the route and the selected cluster and the whole cluster map.
So, let's keep it simple for now and just add an attribute that carries the auto_host_rewrite just like how we pass the selected cluster name from the config selector to the LB policy. Thanks.