Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a step to retrieve the instance-specific endpoint before creating the session client when creating a new spanner client. It includes the following changes: * Added an extra step to get the instance-specific endpoint when creating a new client. * Added a mocked instance admin server for testing purpose. * Added an environment variable "GOOGLE_CLOUD_SPANNER_ENABLE_RESOURCE_BASED_ROUTING" to enable this feature. By default, it is disabled. * If there is a PermissionDenied error when calling GetInstance(), fallback to use the global endpoint or the user-specified endpoint. * Included tests to verify the functionality. Change-Id: Ie447d13b8e414f6299fc56acb678d293531849ae Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/48895 Reviewed-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Reid Hironaga <rhiro@google.com> Reviewed-by: Shanika Kuruppu <skuruppu@google.com>
- Loading branch information
1 parent
b4cdc8d
commit 896180c
Showing
6 changed files
with
509 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.