Send gitaly token to workhorse when needed
This commit is contained in:
parent
76bafc00e6
commit
7bda1030a5
2 changed files with 13 additions and 4 deletions
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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…
Reference in a new issue