From 42507887523f41d0507ca8b1772235846947c3e0 Mon Sep 17 00:00:00 2001 From: rahul2393 Date: Thu, 14 Nov 2024 09:44:57 +0530 Subject: [PATCH] fix(spanner): allow non default service account only when direct path is enabled (#11046) --- spanner/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" {