-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore(spanner): source default opts from gapic client #3572
Conversation
Sources the default client options from the generated client instead of the hand-written client. This makes sure that new default options that are introduced in the future will automatically be picked up by the Spanner client. Fixes #3532
@codyoss @skuruppu While testing something else today, I ran into a slight difference in behavior that was introduced by this change, and I want to check with you whether you consider that a problem:
So this means that the following code snippet would work prior to this change, but will not work any more when using a service account that has been created for the default endpoint, but that is also authorized for the custom endpoint: client, err := spanner.NewClient(
context.Background(),
"projects/my-project/instances/my-instance/databases/my-database",
option.WithEndpoint("custom-endpoint.googleapis.com:443"),
) The following is now needed to make it work: client, err := spanner.NewClient(
context.Background(),
"projects/my-project/instances/my-instance/databases/my-database",
option.WithEndpoint("custom-endpoint.googleapis.com:443"),
option.WithScopes("https://www.googleapis.com/auth/spanner.data"),
) Is this something that we need to do something about? |
@olavloite This sound like it might be a bug. I will investigate and get back to you. Thanks for bringing this to my attention. |
@olavloite This should no longer be an issue on HEAD. Thanks for the report! |
Great, thanks for the update. |
Sources the default client options from the generated client instead of the hand-written client. This makes sure that new default options that are introduced in the future will automatically be picked up by the Spanner client.
Fixes #3532