Skip to content

Commit

Permalink
chore(storage): include grpc enable direct path option (#6569)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Aug 25, 2022
1 parent ad68f56 commit 1937ba4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions storage/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1937ba4

Please sign in to comment.