From 1937ba46bf88497c181fc74b66938c30c26253d1 Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Thu, 25 Aug 2022 14:08:19 -0700 Subject: [PATCH] chore(storage): include grpc enable direct path option (#6569) --- storage/grpc_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/grpc_client.go b/storage/grpc_client.go index 09fddbdf1f78..df1ada07b55b 100644 --- a/storage/grpc_client.go +++ b/storage/grpc_client.go @@ -27,6 +27,7 @@ import ( storagepb "cloud.google.com/go/storage/internal/apiv2/stubs" "google.golang.org/api/iterator" "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" iampb "google.golang.org/genproto/googleapis/iam/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -88,6 +89,9 @@ func defaultGRPCOptions() []option.ClientOption { option.WithGRPCDialOption(grpc.WithInsecure()), option.WithoutAuthentication(), ) + } else { + // Only enable DirectPath when the emulator is not being targeted. + defaults = append(defaults, internaloption.EnableDirectPath(true)) } return defaults