Skip to content

Commit 1937ba4

Browse files
authored
chore(storage): include grpc enable direct path option (#6569)
1 parent ad68f56 commit 1937ba4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

storage/grpc_client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
storagepb "cloud.google.com/go/storage/internal/apiv2/stubs"
2828
"google.golang.org/api/iterator"
2929
"google.golang.org/api/option"
30+
"google.golang.org/api/option/internaloption"
3031
iampb "google.golang.org/genproto/googleapis/iam/v1"
3132
"google.golang.org/grpc"
3233
"google.golang.org/grpc/codes"
@@ -88,6 +89,9 @@ func defaultGRPCOptions() []option.ClientOption {
8889
option.WithGRPCDialOption(grpc.WithInsecure()),
8990
option.WithoutAuthentication(),
9091
)
92+
} else {
93+
// Only enable DirectPath when the emulator is not being targeted.
94+
defaults = append(defaults, internaloption.EnableDirectPath(true))
9195
}
9296

9397
return defaults

0 commit comments

Comments
 (0)