diff --git a/spanner/client.go b/spanner/client.go index 1e21f5934029..6e74dcbe727a 100644 --- a/spanner/client.go +++ b/spanner/client.go @@ -591,11 +591,11 @@ func allClientOpts(numChannels int, compression string, userOpts ...option.Clien clientDefaultOpts := []option.ClientOption{ option.WithGRPCConnectionPool(numChannels), option.WithUserAgent(fmt.Sprintf("spanner-go/v%s", internal.Version)), - internaloption.AllowNonDefaultServiceAccount(true), option.WithGRPCDialOption(grpc.WithChainUnaryInterceptor(addNativeMetricsInterceptor()...)), option.WithGRPCDialOption(grpc.WithChainStreamInterceptor(addStreamNativeMetricsInterceptor()...)), } if enableDirectPathXds, _ := strconv.ParseBool(os.Getenv("GOOGLE_SPANNER_ENABLE_DIRECT_ACCESS")); enableDirectPathXds { + clientDefaultOpts = append(clientDefaultOpts, internaloption.AllowNonDefaultServiceAccount(true)) clientDefaultOpts = append(clientDefaultOpts, internaloption.EnableDirectPath(true), internaloption.EnableDirectPathXds()) } if compression == "gzip" {