Skip to content
Snippets Groups Projects
Commit 01f75c64 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Merge branch '2558-registry-internal-key-populate-should-be-in-rails-recipe' into 'master'

Resolve "Registry internal key populate should be in Rails recipe"

Closes #2558

See merge request !1738
parents cf5b0ee7 683bdcfb
No related branches found
No related tags found
1 merge request!1738Resolve "Registry internal key populate should be in Rails recipe"
Loading
Loading
@@ -111,6 +111,14 @@ directory gitlab_ci_dir do
recursive true
end
 
key_file_path = node['gitlab']['gitlab-rails']['registry_key_path']
file key_file_path do
content node['registry']['internal_key']
owner gitlab_user
group gitlab_group
only_if { node['gitlab']['gitlab-rails']['registry_enabled'] && node['registry']['internal_key'] }
end
template File.join(gitlab_rails_static_etc_dir, "gitlab-rails-rc")
 
dependent_services = []
Loading
Loading
Loading
Loading
@@ -57,13 +57,6 @@ directory node['gitlab']['gitlab-rails']['registry_path'] do
only_if { node['gitlab']['manage-storage-directories']['enable'] }
end
 
key_file_path = node['gitlab']['gitlab-rails']['registry_key_path']
file key_file_path do
content node['registry']['internal_key']
owner account_helper.gitlab_user
group account_helper.gitlab_group
end
cert_file_path = File.join(working_dir, "gitlab-registry.crt")
node.default['registry']['rootcertbundle'] = cert_file_path
file cert_file_path do
Loading
Loading
Loading
Loading
@@ -655,4 +655,25 @@ describe 'gitlab::gitlab-rails' do
end
end
end
context 'gitlab registry' do
describe 'registry is disabled' do
it 'does not generate gitlab-registry.key file' do
expect(chef_run).not_to render_file("/var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key")
end
end
describe 'registry is enabled' do
before do
stub_gitlab_rb(
gitlab_rails: {
registry_enabled: true
}
)
end
it 'generates gitlab-registry.key file' do
expect(chef_run).to render_file("/var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key").with_content(/\A-----BEGIN RSA PRIVATE KEY-----\n.+\n-----END RSA PRIVATE KEY-----\n\Z/m)
end
end
end
end
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