Skip to content

xds: Support :authority header rewriting for LOGICAL_DNS clusters#8822

Merged
easwars merged 1 commit intogrpc:masterfrom
110y:xds-cds-hostname
Jan 21, 2026
Merged

xds: Support :authority header rewriting for LOGICAL_DNS clusters#8822
easwars merged 1 commit intogrpc:masterfrom
110y:xds-cds-hostname

Conversation

@110y
Copy link
Contributor

@110y 110y commented Jan 12, 2026

What

This PR enables Auto Host Rewriting for Logical_DNS clusters by setting DNS Hostname as an Endpoint Attribute.

Why

With current grpc-go's gRFC A81 implementation, Auto Host Rewriting is not enabled even when a Route config enables AutoHostRewrite and GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE is set to be true when a Cluster config uses Logical DNS (current implementation seems supports only EDS).

RELEASE NOTES:

  • xDS: Added support for :authority rewriting (gRFC A81) for LOGICAL_DNS clusters

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.32%. Comparing base (679565f) to head (b08ad38).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8822      +/-   ##
==========================================
- Coverage   83.42%   83.32%   -0.11%     
==========================================
  Files         414      414              
  Lines       32763    32763              
==========================================
- Hits        27334    27299      -35     
- Misses       4040     4062      +22     
- Partials     1389     1402      +13     
Files with missing lines Coverage Δ
...rnal/xds/balancer/clusterresolver/configbuilder.go 94.02% <100.00%> (ø)
...nternal/xds/xdsclient/xdsresource/unmarshal_eds.go 94.73% <100.00%> (ø)

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@easwars
Copy link
Contributor

easwars commented Jan 14, 2026

@Pranjali-2501 : If it is true that we missed support for LOGICAL_DNS clusters, then it is a bug because A81 does mention it.

@easwars easwars added this to the 1.79 Release milestone Jan 14, 2026
@easwars easwars removed their assignment Jan 14, 2026
@easwars
Copy link
Contributor

easwars commented Jan 14, 2026

@Pranjali-2501 : Can you please make a first pass and loop me in once the changes look good to you.

Copy link
Contributor

@Pranjali-2501 Pranjali-2501 left a comment

Choose a reason for hiding this comment

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

Thanks @110y for taking the initiative to fix this.

@Pranjali-2501 Pranjali-2501 assigned 110y and unassigned Pranjali-2501 Jan 14, 2026
@110y 110y force-pushed the xds-cds-hostname branch from 62079e5 to 0f1c58c Compare January 14, 2026 16:27
@110y 110y requested a review from Pranjali-2501 January 14, 2026 16:31
@110y 110y force-pushed the xds-cds-hostname branch from 0f1c58c to c744f86 Compare January 15, 2026 01:38
@110y
Copy link
Contributor Author

110y commented Jan 15, 2026

@Pranjali-2501

Updated! Please take another look

@110y 110y requested a review from Pranjali-2501 January 15, 2026 08:22
@Pranjali-2501 Pranjali-2501 assigned Pranjali-2501 and unassigned 110y Jan 19, 2026
Copy link
Contributor

@Pranjali-2501 Pranjali-2501 left a comment

Choose a reason for hiding this comment

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

LGTM.
Assigning it to @easwars for second pass.

Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

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

LGTM modulo minor nits

pName := fmt.Sprintf("priority-%v", g.prefix)
for i, e := range endpoints {
retEndpoints[i] = hierarchy.SetInEndpoint(e, []string{pName})
// Set hostname for gRFC A81 authority rewriting.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please replace the existing comment with something like this which adds more information:

// For Logical DNS clusters, the same hostname attribute is added
// to all endpoints. It is set to the name that is resolved for the
// Logical DNS cluster, including the port number.

// configureXDSResources configures the management server with a route that
// enables auto_host_rewrite and an endpoint with the specified hostname.
func configureXDSResources(ctx context.Context, t *testing.T, mgmtServer *e2e.ManagementServer, nodeID string, serverAddr string, endpointHostname string, secLevel e2e.SecurityLevel) {
func configureXDSResources(ctx context.Context, t *testing.T, mgmtServer *e2e.ManagementServer, nodeID string, serverAddr string, endpointHostname string, secLevel e2e.SecurityLevel, clusterType e2e.ClusterType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: While you are here, could you please shorten the parameter list a bit by doing this:

func configureXDSResources(ctx context.Context, t *testing.T, mgmtServer *e2e.ManagementServer, nodeID, serverAddr, endpointHostname string, secLevel e2e.SecurityLevel, clusterType e2e.ClusterType) { ... }

Thanks

@easwars easwars changed the title xds: :authority header rewriting for cds + logical dns xds: Support :authority header rewriting for LOGICAL_DNS clusters Jan 20, 2026
@easwars
Copy link
Contributor

easwars commented Jan 20, 2026

@eshitachandwani : FYI when you delete the clusterresolver LB policy, please ensure that this new functionality is carried over the CDS policy. Thanks.

@easwars easwars assigned 110y and unassigned easwars Jan 20, 2026
@110y 110y force-pushed the xds-cds-hostname branch from c744f86 to b08ad38 Compare January 21, 2026 02:30
@110y
Copy link
Contributor Author

110y commented Jan 21, 2026

@easwars

I resolved a conflict and update as you commented. Please take another look, thanks 🙏

@easwars
Copy link
Contributor

easwars commented Jan 21, 2026

@110y : Thank you for your contribution!

@easwars easwars merged commit 0381eb6 into grpc:master Jan 21, 2026
14 checks passed
@110y 110y deleted the xds-cds-hostname branch January 21, 2026 07:40
@110y
Copy link
Contributor Author

110y commented Jan 21, 2026

@easwars @Pranjali-2501

Thank you for your reviews!

@easwars
Copy link
Contributor

easwars commented Jan 21, 2026

@110y : Do let us know if you are interested in making more contributions. We are always looking for more contributions from the community and would be happy to review code/design etc.

@110y
Copy link
Contributor Author

110y commented Jan 22, 2026

@easwars

Yes, I'm interested as I'm a fan of gRPC ecosystem! If we have any tasks or issues for beginners, I would appreciate it if you could introduce me to them. Thanks!

P.S.
By the way, I finally solve problems below by gRFC A81 implementation and my first contribution for grpc-go 😄 (Thank you for that time too!)

mbissa pushed a commit to mbissa/grpc-go that referenced this pull request Feb 16, 2026
…rpc#8822)

## What

This PR enables Auto Host Rewriting for Logical_DNS clusters by setting
DNS Hostname as an Endpoint Attribute.

## Why

With current grpc-go's gRFC A81 implementation, Auto Host Rewriting is
not enabled even when a Route config enables AutoHostRewrite and
GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE is set to be true when a Cluster
config uses Logical DNS (current implementation seems supports only
EDS).

RELEASE NOTES:

- xDS: Added support for :authority rewriting (gRFC A81) for
LOGICAL_DNS clusters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants