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

xds: set dial target in request resource_names #3081

Merged
merged 3 commits into from
Oct 14, 2019

Conversation

menghanl
Copy link
Contributor

@menghanl menghanl commented Oct 8, 2019

And stop sending metadata TRAFFICDIRECTOR_GRPC_HOSTNAME.
Similarly, for LRS, cluster_name is set to the dial target.


The expected resource_names can be in a different format from dial target. (test_service.test_namespace.traffic_director.com vs test_namespace:test_service). The mapping will be done by LDS/RDS/VHDS + CDS.

The workaround was to leave resource_names empty, and send dial target as metadata TRAFFICDIRECTOR_GRPC_HOSTNAME.
This change sets dial target directly in resource_names, and removes metadata. The server don't need to read the metadata for service name, but needs to support two formats of resrouce_names (test_service.test_namespace.traffic_director.com and test_namespace:test_service).

When all the missing pieces are done, resource_names will be set as the cluster names from CDS response.
For LRS, cluster_name will be set to the same name.

@menghanl menghanl requested a review from easwars October 8, 2019 21:14
@menghanl menghanl added this to the 1.25 Release milestone Oct 8, 2019
@menghanl menghanl added the Type: Internal Cleanup Refactors, etc label Oct 8, 2019
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.

I understand the changed, although I don't seem to understand why we are doing these changes. Could you please expand the commit message to give some details. Thanks.

@easwars easwars assigned menghanl and unassigned easwars Oct 8, 2019
@menghanl
Copy link
Contributor Author

menghanl commented Oct 9, 2019

PR description updated.

@menghanl menghanl assigned easwars and unassigned menghanl Oct 9, 2019
Comment on lines -155 to -163
node: &basepb.Node{
Metadata: &structpb.Struct{
Fields: map[string]*structpb.Value{
internal.GrpcHostname: {
Kind: &structpb.Value_StringValue{StringValue: serviceName},
},
},
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Will LRS be eventually moved to the xdsClient and will a nodeProto (read from the bootstrap file) be added to the request there? If not, is OK to not have a nodeProto at all in the LRS request?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, LRS will be moved to the same xdsClient.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a TODO to say that we should add the NodeProto here once we move it to the xdsClient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@menghanl menghanl merged commit 0859afa into grpc:master Oct 14, 2019
@menghanl menghanl deleted the xds_service_name_in_resource_names branch October 14, 2019 16:32
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants