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

Merge branch '7743-fix-gitaly-storage-deprecation-notice' into 'master'

Use new Gitaly configuration format to set default storages

Closes #7743

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6808



Merged-by: default avatarRobert Marshall <rmarshall@gitlab.com>
Approved-by: default avatarRobert Marshall <rmarshall@gitlab.com>
Co-authored-by: default avatarBalasankar "Balu" C <balasankar@gitlab.com>
parents 0d79ab3e a2e300be
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -93,7 +93,8 @@ module Gitaly
'path' => value['path']
}
end
Gitlab['gitaly']['storage'] = storages
Gitlab['gitaly']['configuration'] ||= {}
Gitlab['gitaly']['configuration']['storage'] = storages
end
 
# Compute the default gitconfig from the old Omnibus gitconfig setting.
Loading
Loading
Loading
Loading
@@ -912,13 +912,15 @@ RSpec.describe 'gitaly' do
context 'using local gitaly' do
before do
stub_gitlab_rb(
{
gitaly: { storage: nil },
git_data_dirs:
{
'default' => { 'path' => '/tmp/default/git-data' },
'nfs1' => { 'path' => '/mnt/nfs1' }
gitaly: {
configuration: {
storage: nil
}
},
git_data_dirs:
{
'default' => { 'path' => '/tmp/default/git-data' },
'nfs1' => { 'path' => '/mnt/nfs1' }
}
)
end
Loading
Loading
@@ -936,12 +938,14 @@ RSpec.describe 'gitaly' do
context 'using external gitaly' do
before do
stub_gitlab_rb(
{
gitaly: { storage: nil },
git_data_dirs:
{
'default' => { 'gitaly_address' => 'tcp://gitaly.internal:8075' },
gitaly: {
configuration: {
storage: nil
}
},
git_data_dirs:
{
'default' => { 'gitaly_address' => 'tcp://gitaly.internal:8075' },
}
)
end
Loading
Loading
@@ -953,6 +957,68 @@ RSpec.describe 'gitaly' do
.with_content('gitaly_address: "tcp://gitaly.internal:8075"')
end
end
context "when gitaly storage is explicitly set" do
context "using gitaly['configuration']['storage'] key" do
before do
stub_gitlab_rb(
gitaly: {
configuration: {
storage: [
{
'name' => 'nfs1',
'path' => '/mnt/nfs1/repositories'
},
{
'name' => 'default',
'path' => '/tmp/default/git-data/repositories'
}
]
}
},
git_data_dirs: {
'default' => { 'path' => '/tmp/gitaly-git-data' },
}
)
end
it 'populates gitaly config.toml with custom storages from gitaly configuration' do
expect(chef_run).to render_file(config_path)
.with_content(%r{\[\[storage\]\]\s+name = "default"\s+path = "/tmp/default/git-data/repositories"})
expect(chef_run).to render_file(config_path)
.with_content(%r{\[\[storage\]\]\s+name = "nfs1"\s+path = "/mnt/nfs1/repositories"})
end
end
context "using legacy gitaly['storage'] key" do
before do
stub_gitlab_rb(
gitaly: {
storage: [
{
'name' => 'nfs1',
'path' => '/mnt/nfs1/repositories'
},
{
'name' => 'default',
'path' => '/tmp/default/git-data/repositories'
}
]
},
git_data_dirs: {
'default' => { 'path' => '/tmp/gitaly-git-data' },
}
)
end
it 'populates gitaly config.toml with custom storages from gitaly configuration' do
expect(chef_run).to render_file(config_path)
.with_content(%r{\[\[storage\]\]\s+name = "default"\s+path = "/tmp/default/git-data/repositories"})
expect(chef_run).to render_file(config_path)
.with_content(%r{\[\[storage\]\]\s+name = "nfs1"\s+path = "/mnt/nfs1/repositories"})
end
end
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