Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/envconfig/envconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ var (
// - Target resolution is disabled.
// - The DNS resolver is being used.
EnableDefaultPortForProxyTarget = boolFromEnv("GRPC_EXPERIMENTAL_ENABLE_DEFAULT_PORT_FOR_PROXY_TARGET", true)

// XDSAuthorityRewrite indicates whether xDS authority rewriting is enabled.
// This feature is defined in gRFC A81 and is enabled by setting the
// environment variable GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE to "true".
XDSAuthorityRewrite = boolFromEnv("GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE", false)
)

func boolFromEnv(envVar string, def bool) bool {
Expand Down
2 changes: 1 addition & 1 deletion internal/xds/xdsclient/xdsresource/filter_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ func processNetworkFilters(filters []*v3listenerpb.Filter) (*FilterChain, error)
// server-side." - A36
// Can specify v3 here, as will never get to this function
// if v2.
routeU, err := generateRDSUpdateFromRouteConfiguration(hcm.GetRouteConfig())
routeU, err := generateRDSUpdateFromRouteConfiguration(hcm.GetRouteConfig(), nil)
if err != nil {
return nil, fmt.Errorf("failed to parse inline RDS resp: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/xds/xdsclient/xdsresource/listener_resource_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type listenerResourceDecoder struct {
bootstrapConfig *bootstrap.Config
}

func (d *listenerResourceDecoder) Decode(resource *xdsclient.AnyProto, _ xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) {
name, listener, err := unmarshalListenerResource(resource.ToAny())
func (d *listenerResourceDecoder) Decode(resource *xdsclient.AnyProto, opts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) {
name, listener, err := unmarshalListenerResource(resource.ToAny(), &opts)
if name == "" {
// Name is unset only when protobuf deserialization fails.
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ type routeConfigResourceDecoder struct {
bootstrapConfig *bootstrap.Config
}

func (d *routeConfigResourceDecoder) Decode(resource *xdsclient.AnyProto, _ xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) {
name, rc, err := unmarshalRouteConfigResource(resource.ToAny())
func (d *routeConfigResourceDecoder) Decode(resource *xdsclient.AnyProto, opts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) {
name, rc, err := unmarshalRouteConfigResource(resource.ToAny(), &opts)
if name == "" {
// Name is unset only when protobuf deserialization fails.
return nil, err
Expand Down
1 change: 1 addition & 0 deletions internal/xds/xdsclient/xdsresource/type_eds.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Endpoint struct {
Weight uint32
HashKey string
Metadata map[string]any
Hostname string
}

// Locality contains information of a locality.
Expand Down
3 changes: 3 additions & 0 deletions internal/xds/xdsclient/xdsresource/type_rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ type Route struct {
// ClusterSpecifierPlugin is the name of the Cluster Specifier Plugin that
// this Route is linked to, if specified by xDS.
ClusterSpecifierPlugin string
// AutoHostRewrite indicates that the ":authority" header can be rewritten
// to the hostname of the upstream endpoint.
AutoHostRewrite bool
}

// WeightedCluster contains settings for an xds ActionType.WeightedCluster.
Expand Down
1 change: 1 addition & 0 deletions internal/xds/xdsclient/xdsresource/unmarshal_eds.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func parseEndpoints(lbEndpoints []*v3endpointpb.LbEndpoint, uniqueEndpointAddrs
Weight: weight,
HashKey: hashKey,
Metadata: endpointMetadata,
Hostname: lbEndpoint.GetEndpoint().GetHostname(),
})
}
return endpoints, nil
Expand Down
Loading