Skip to content

Commit

Permalink
fix(spanner): set 'gccl' to the request header. (#2609)
Browse files Browse the repository at this point in the history
  • Loading branch information
hengfengli committed Jul 16, 2020
1 parent b2f2083 commit a31e954
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spanner/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func setupMockedTestServerWithConfigAndClientOptions(t *testing.T, config Client
if !strings.HasPrefix(token[0], "gl-go/") {
return status.Errorf(codes.Internal, "unexpected api client token: %v", token[0])
}
if !strings.Contains(token[0], "gccl/") {
return status.Errorf(codes.Internal, "unexpected api client token: %v", token[0])
}
return nil
},
},
Expand Down
2 changes: 2 additions & 0 deletions spanner/sessionclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"time"

"cloud.google.com/go/internal/trace"
"cloud.google.com/go/internal/version"
vkit "cloud.google.com/go/spanner/apiv1"
"google.golang.org/api/option"
gtransport "google.golang.org/api/transport/grpc"
Expand Down Expand Up @@ -272,5 +273,6 @@ func (sc *sessionClient) nextClient() (*vkit.Client, error) {
if err != nil {
return nil, err
}
client.SetGoogleClientInfo("gccl", version.Repo)
return client, nil
}

0 comments on commit a31e954

Please sign in to comment.