Skip to content
Snippets Groups Projects
Commit 85a9b165 authored by Robert Marshall's avatar Robert Marshall
Browse files

Add updates based on merge conflict


- Merge conflict resolution during the rebase touched a few places that
  needed updates to use the Workhorse Helper.
- Updated gitaly rspec to match the new expectations

Signed-off-by: default avatarRobert Marshall <rmarshall@gitlab.com>
parent 11a062b7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -14,14 +14,15 @@ class WebServerHelper
end
 
def internal_api_url(node)
workhorse_helper = GitlabWorkhorseHelper.new(node)
gitlab_url = node['gitlab']['gitlab-rails']['internal_api_url']
 
# If no internal_api_url is specified, default to Workhorse settings
use_socket = node['gitlab']['gitlab-workhorse']['listen_network'] == "unix"
workhorse_url = node['gitlab']['gitlab-workhorse']['listen_addr']
workhorse_url = workhorse_helper.socket_file_path
relative_path = Gitlab['gitlab_workhorse']['relative_url']
gitlab_url ||= use_socket ? "http+unix://#{ERB::Util.url_encode(workhorse_url)}" : "http://#{workhorse_url}#{relative_path}"
gitlab_relative_path = relative_path || '' if use_socket
gitlab_url ||= workhorse_helper.unix_socket? ? "http+unix://#{ERB::Util.url_encode(workhorse_url)}" : "http://#{workhorse_url}#{relative_path}"
gitlab_relative_path = relative_path || '' if workhorse_helper.unix_socket?
 
[gitlab_url, gitlab_relative_path]
end
Loading
Loading
Loading
Loading
@@ -144,7 +144,7 @@ RSpec.describe 'gitaly' do
 
it 'populates gitaly config.toml with gitlab-workhorse socket' do
expect(chef_run).to render_file(config_path)
.with_content(%r{\[gitlab\]\s+url = 'http\+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket'\s+relative_url_root = ''})
.with_content(%r{\[gitlab\]\s+url = 'http\+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsockets%2Fsocket'\s+relative_url_root = ''})
end
end
 
Loading
Loading
@@ -494,7 +494,7 @@ RSpec.describe 'gitaly' do
 
it 'create config file with provided values' do
expect(chef_run).to render_file(config_path)
.with_content(%r{\[gitlab\]\s+url = 'http\+unix://%2Ffake%2Fworkhorse%2Fsocket'\s+relative_url_root = ''})
.with_content(%r{\[gitlab\]\s+url = 'http\+unix://%2Ffake%2Fworkhorse%2Fsockets%2Fsocket'\s+relative_url_root = ''})
end
end
 
Loading
Loading
@@ -524,7 +524,7 @@ RSpec.describe 'gitaly' do
 
it 'create config file with the relative_url_root set' do
expect(chef_run).to render_file(config_path)
.with_content(%r{\[gitlab\]\s+url = 'http\+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket'\s+relative_url_root = '/gitlab'})
.with_content(%r{\[gitlab\]\s+url = 'http\+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsockets%2Fsocket'\s+relative_url_root = '/gitlab'})
end
end
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