Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-02-22 14:10:14 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-02-24 16:41:04 +0300
commit024ca6b05784f7c37e0528622346e9e6179b2309 (patch)
treee96d88006229d8afbf6285726df7272881834d83
parent96219c188eb5550b2835468c35a894e2e16adc58 (diff)
blob: Make config available
The BlobService server does not currently have access to the Gitaly config. This commit makes it available such that we can use it in a follow-up commit.
-rw-r--r--internal/gitaly/service/blob/server.go11
-rw-r--r--internal/gitaly/service/blob/testhelper_test.go2
-rw-r--r--internal/gitaly/service/register.go2
3 files changed, 11 insertions, 4 deletions
diff --git a/internal/gitaly/service/blob/server.go b/internal/gitaly/service/blob/server.go
index 07d414c31..42b0809ab 100644
--- a/internal/gitaly/service/blob/server.go
+++ b/internal/gitaly/service/blob/server.go
@@ -2,6 +2,7 @@ package blob
import (
"gitlab.com/gitlab-org/gitaly/internal/git"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver"
"gitlab.com/gitlab-org/gitaly/internal/storage"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
@@ -9,11 +10,17 @@ import (
type server struct {
ruby *rubyserver.Server
+ cfg config.Cfg
locator storage.Locator
gitCmdFactory git.CommandFactory
}
// NewServer creates a new instance of a grpc BlobServer
-func NewServer(rs *rubyserver.Server, locator storage.Locator, gitCmdFactory git.CommandFactory) gitalypb.BlobServiceServer {
- return &server{ruby: rs, locator: locator, gitCmdFactory: gitCmdFactory}
+func NewServer(rs *rubyserver.Server, cfg config.Cfg, locator storage.Locator, gitCmdFactory git.CommandFactory) gitalypb.BlobServiceServer {
+ return &server{
+ ruby: rs,
+ cfg: cfg,
+ locator: locator,
+ gitCmdFactory: gitCmdFactory,
+ }
}
diff --git a/internal/gitaly/service/blob/testhelper_test.go b/internal/gitaly/service/blob/testhelper_test.go
index ad0583813..b3b4ddb59 100644
--- a/internal/gitaly/service/blob/testhelper_test.go
+++ b/internal/gitaly/service/blob/testhelper_test.go
@@ -45,7 +45,7 @@ func testMain(m *testing.M) int {
func runBlobServer(t *testing.T, locator storage.Locator) (func(), string) {
srv := testhelper.NewServer(t, nil, nil)
- gitalypb.RegisterBlobServiceServer(srv.GrpcServer(), NewServer(rubyServer, locator, git.NewExecCommandFactory(config.Config)))
+ gitalypb.RegisterBlobServiceServer(srv.GrpcServer(), NewServer(rubyServer, config.Config, locator, git.NewExecCommandFactory(config.Config)))
reflection.Register(srv.GrpcServer())
srv.Start(t)
diff --git a/internal/gitaly/service/register.go b/internal/gitaly/service/register.go
index bfb673e22..df898e5ca 100644
--- a/internal/gitaly/service/register.go
+++ b/internal/gitaly/service/register.go
@@ -69,7 +69,7 @@ func RegisterAll(
conns *client.Pool,
gitCmdFactory git.CommandFactory,
) {
- gitalypb.RegisterBlobServiceServer(grpcServer, blob.NewServer(rubyServer, locator, gitCmdFactory))
+ gitalypb.RegisterBlobServiceServer(grpcServer, blob.NewServer(rubyServer, cfg, locator, gitCmdFactory))
gitalypb.RegisterCleanupServiceServer(grpcServer, cleanup.NewServer(cfg, gitCmdFactory))
gitalypb.RegisterCommitServiceServer(grpcServer, commit.NewServer(cfg, locator, gitCmdFactory))
gitalypb.RegisterDiffServiceServer(grpcServer, diff.NewServer(cfg, locator, gitCmdFactory))