Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc-js-xds: Use authority override to select VirtualHost when provided #2207

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/grpc-js-xds/src/resolver-xds.ts
Expand Up @@ -319,9 +319,12 @@ class XdsResolver implements Resolver {
private handleRouteConfig(routeConfig: RouteConfiguration__Output, isV2: boolean) {
this.latestRouteConfig = routeConfig;
this.latestRouteConfigIsV2 = isV2;
const virtualHost = findVirtualHostForDomain(routeConfig.virtual_hosts, this.target.path);
/* Select the virtual host using the default authority override if it
* exists, and the channel target otherwise. */
const hostDomain = this.channelOptions['grpc.default_authority'] ?? this.target.path;
const virtualHost = findVirtualHostForDomain(routeConfig.virtual_hosts, hostDomain);
if (virtualHost === null) {
this.reportResolutionError('No matching route found');
this.reportResolutionError('No matching route found for ' + hostDomain);
return;
}
const virtualHostHttpFilterOverrides = new Map<string, HttpFilterConfig>();
Expand Down