Skip to content

Commit e4b663c

Browse files
feat: allow attempt direct path xds via env var (#9582)
Co-authored-by: rahul2393 <irahul@google.com>
1 parent 1a04baf commit e4b663c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

spanner/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"log"
2424
"os"
2525
"regexp"
26+
"strconv"
2627
"time"
2728

2829
"cloud.google.com/go/internal/trace"
@@ -353,6 +354,9 @@ func allClientOpts(numChannels int, compression string, userOpts ...option.Clien
353354
internaloption.EnableDirectPath(true),
354355
internaloption.AllowNonDefaultServiceAccount(true),
355356
}
357+
if enableDirectPathXds, _ := strconv.ParseBool(os.Getenv("GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS")); enableDirectPathXds {
358+
clientDefaultOpts = append(clientDefaultOpts, internaloption.EnableDirectPathXds())
359+
}
356360
if compression == "gzip" {
357361
userOpts = append(userOpts, option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
358362
grpc.UseCompressor(gzip.Name))))

0 commit comments

Comments
 (0)