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>2022-02-15 16:38:34 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-03-01 10:24:01 +0300
commit281ffc54d0a19b495dbb048c7419b161b9e5951d (patch)
tree2af973c6b9c7734690b3657ac09084bb05c6d2c6
parent29e11b58a847bcf87055cea2f30afd7a9c2accb4 (diff)
praefect: Pass feature flags to Gitaly when executing ServerInfo
When Praefect receives a ServerInfo RPC it forwards the request to proxied Gitaly nodes to obtain their information and then pass it through back to the caller. We do not forward the RPC metadata correctly though, and as a result any feature flags passed to Praefect will not end up with Gitaly. Fix this by converting the incoming to an outgoing context before doing the RPC calls to Gitaly. Changelog: fixed
-rw-r--r--internal/praefect/service/server/info.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/praefect/service/server/info.go b/internal/praefect/service/server/info.go
index 1ca09a871..841860b52 100644
--- a/internal/praefect/service/server/info.go
+++ b/internal/praefect/service/server/info.go
@@ -6,6 +6,7 @@ import (
"github.com/google/uuid"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus"
+ "gitlab.com/gitlab-org/gitaly/v14/internal/metadata"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
"google.golang.org/grpc"
)
@@ -29,6 +30,7 @@ func (s *Server) ServerInfo(ctx context.Context, in *gitalypb.ServerInfoRequest)
var wg sync.WaitGroup
storageStatuses := make([]*gitalypb.ServerInfoResponse_StorageStatus, len(s.conns))
+ ctx = metadata.IncomingToOutgoing(ctx)
i := 0
for virtualStorage, storages := range s.conns {