Skip to content
Snippets Groups Projects
Commit 734c5d0e authored by Paul Okstad's avatar Paul Okstad
Browse files

Remove Praefect primary config

Removes the generation of the "primary" field from the Praefect virtual
storages. This field is no longer used by Gitaly as of
https://gitlab.com/gitlab-org/gitaly/-/merge_requests/2392

Closes https://gitlab.com/gitlab-org/gitaly/-/issues/2634
parent 7404f617
No related branches found
No related tags found
No related merge requests found
---
title: Remove Praefect primary config
merge_request: 4559
author:
type: other
Loading
Loading
@@ -68,7 +68,6 @@ name = '<%= name %>'
storage = '<%= storage %>'
address = '<%= node['address'] %>'
token = '<%= node['token'] %>'
primary = <%= [true, 'true'].include?(node['primary']) %>
<% end %>
<% end %>
 
Loading
Loading
Loading
Loading
@@ -92,10 +92,10 @@ RSpec.describe 'praefect' do
let(:virtual_storages) do
{
'default' => {
'praefect1' => { address: 'tcp://node1.internal', primary: true, token: "praefect1-token" },
'praefect2' => { address: 'tcp://node2.internal', primary: 'true', token: "praefect2-token" },
'praefect3' => { address: 'tcp://node3.internal', primary: false, token: "praefect3-token" },
'praefect4' => { address: 'tcp://node4.internal', primary: 'false', token: "praefect4-token" },
'praefect1' => { address: 'tcp://node1.internal', token: "praefect1-token" },
'praefect2' => { address: 'tcp://node2.internal', token: "praefect2-token" },
'praefect3' => { address: 'tcp://node3.internal', token: "praefect3-token" },
'praefect4' => { address: 'tcp://node4.internal', token: "praefect4-token" },
'praefect5' => { address: 'tcp://node5.internal', token: "praefect5-token" }
}
}
Loading
Loading
@@ -186,10 +186,8 @@ RSpec.describe 'praefect' do
virtual_storages.each do |name, nodes|
expect(chef_run).to render_file(config_path).with_content(%r{^\[\[virtual_storage\]\]\nname = '#{name}'\n})
nodes.each do |storage, node|
expect_primary = primaries.include?(storage)
expect(chef_run).to render_file(config_path)
.with_content(%r{^\[\[virtual_storage.node\]\]\nstorage = '#{storage}'\naddress = '#{node[:address]}'\ntoken = '#{node[:token]}'\nprimary = #{expect_primary}\n})
.with_content(%r{^\[\[virtual_storage.node\]\]\nstorage = '#{storage}'\naddress = '#{node[:address]}'\ntoken = '#{node[:token]}'\n})
end
end
 
Loading
Loading
@@ -215,7 +213,7 @@ RSpec.describe 'praefect' do
end
 
context 'with virtual_storages as an array' do
let(:virtual_storages) { [{ name: 'default', 'nodes' => [{ storage: 'praefect1', address: 'tcp://node1.internal', primary: true, token: "praefect1-token" }] }] }
let(:virtual_storages) { [{ name: 'default', 'nodes' => [{ storage: 'praefect1', address: 'tcp://node1.internal', token: "praefect1-token" }] }] }
 
it 'raises an error' do
expect { chef_run }.to raise_error("Praefect virtual_storages must be a hash")
Loading
Loading
@@ -223,7 +221,7 @@ RSpec.describe 'praefect' do
end
 
context 'with nodes within virtual_storages as an array' do
let(:virtual_storages) { { 'default' => [{ storage: 'praefect1', address: 'tcp://node1.internal', primary: true, token: "praefect1-token" }] } }
let(:virtual_storages) { { 'default' => [{ storage: 'praefect1', address: 'tcp://node1.internal', token: "praefect1-token" }] } }
 
it 'raises an error' do
expect { chef_run }.to raise_error("nodes of a Praefect virtual_storage must be a hash")
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