Skip to content
Snippets Groups Projects
Commit 7bda1030 authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Send gitaly token to workhorse when needed

parent 76bafc00
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -26,7 +26,10 @@ module Gitlab
}
 
if Gitlab.config.gitaly.enabled
address = Gitlab::GitalyClient.address(project.repository_storage)
server = {
address: Gitlab::GitalyClient.address(project.repository_storage),
token: Gitlab::GitalyClient.token(project.repository_storage),
}
params[:Repository] = repository.gitaly_repository.to_h
 
feature_enabled = case action.to_s
Loading
Loading
@@ -39,8 +42,10 @@ module Gitlab
else
raise "Unsupported action: #{action}"
end
params[:GitalyAddress] = address if feature_enabled
if feature_enabled
params[:GitalyAddress] = server[:address] # This field will be deprecated
params[:GitalyServer] = server
end
end
 
params
Loading
Loading
Loading
Loading
@@ -202,7 +202,11 @@ describe Gitlab::Workhorse, lib: true do
context 'when Gitaly is enabled' do
let(:gitaly_params) do
{
GitalyAddress: Gitlab::GitalyClient.address('default')
GitalyAddress: Gitlab::GitalyClient.address('default'),
GitalyServer: {
address: Gitlab::GitalyClient.address('default'),
token: Gitlab::GitalyClient.token('default')
}
}
end
 
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