As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit 7d86c9a7 authored by Nick Thomas's avatar Nick Thomas
Browse files

Merge branch 'cl-client-name' into 'master'

Set client name when making requests to Gitaly

See merge request gitlab-org/gitlab-shell!387
parents a38da6c1 48b0bbd5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -5,10 +5,11 @@ go 1.12
require (
github.com/mattn/go-shellwords v0.0.0-20190425161501-2444a32a19f4
github.com/otiai10/copy v1.0.1
github.com/sirupsen/logrus v1.2.0
github.com/stretchr/testify v1.3.0
github.com/otiai10/curr v1.0.0 // indirect
github.com/sirupsen/logrus v1.3.0
github.com/stretchr/testify v1.4.0
gitlab.com/gitlab-org/gitaly v1.68.0
gitlab.com/gitlab-org/labkit v0.0.0-20190221122536-0c3fc7cdd57c
gitlab.com/gitlab-org/labkit v0.0.0-20200507062444-0149780c759d
google.golang.org/grpc v1.24.0
gopkg.in/yaml.v2 v2.2.2
gopkg.in/yaml.v2 v2.2.4
)
This diff is collapsed.
Loading
Loading
@@ -8,12 +8,13 @@ import (
log "github.com/sirupsen/logrus"
"gitlab.com/gitlab-org/gitaly/auth"
gitalyauth "gitlab.com/gitlab-org/gitaly/auth"
"gitlab.com/gitlab-org/gitaly/client"
pb "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/executable"
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/accessverifier"
grpccorrelation "gitlab.com/gitlab-org/labkit/correlation/grpc"
"gitlab.com/gitlab-org/labkit/tracing"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
Loading
Loading
@@ -87,7 +88,19 @@ func getConn(gc *GitalyCommand) (*GitalyConn, error) {
connOpts := client.DefaultDialOpts
if gc.Token != "" {
connOpts = append(client.DefaultDialOpts, grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(gc.Token)))
connOpts = append(client.DefaultDialOpts,
grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(gc.Token)),
grpc.WithStreamInterceptor(
grpccorrelation.StreamClientCorrelationInterceptor(
grpccorrelation.WithClientName(executable.GitlabShell),
),
),
grpc.WithUnaryInterceptor(
grpccorrelation.UnaryClientCorrelationInterceptor(
grpccorrelation.WithClientName(executable.GitlabShell),
),
),
)
}
// Use a working directory that won't get removed or unmounted.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment