File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
files/gitlab-cookbooks/gitlab/templates/default
spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -453,8 +453,12 @@ production: &base
453453 log_format: <%= @sidekiq['log_format'] %>
454454 <% unless @sidekiq['routing_rules'].empty? %>
455455 routing_rules:
456- <% @sidekiq['routing_rules'].each do |query, queue| %>
456+ <% @sidekiq['routing_rules'].each do |query, queue, shard_instance| %>
457+ <% if shard_instance.nil? %>
457458 - [<%= quote(query) %> , <%= queue.nil? ? 'null' : quote(queue) %> ]
459+ <% else %>
460+ - [<%= quote(query) %> , <%= queue.nil? ? 'null' : quote(queue) %> , <%= quote(shard_instance) %> ]
461+ <% end %>
458462 <% end %>
459463 <% end %>
460464
Original file line number Diff line number Diff line change 7474 )
7575 end
7676 end
77+
78+ context 'with a valid routing rules list containing shard details' do
79+ before do
80+ stub_gitlab_rb (
81+ sidekiq : {
82+ routing_rules : [
83+ [ "resource_boundary=cpu" , "cpu_boundary" ] ,
84+ [ "*" , "default" , "default" ]
85+ ]
86+ }
87+ )
88+ end
89+
90+ it 'renders gitlab.yml with user specified value for sidekiq routing rules' do
91+ expect ( gitlab_yml [ :production ] [ :sidekiq ] [ :routing_rules ] ) . to eq (
92+ [
93+ [ "resource_boundary=cpu" , "cpu_boundary" ] ,
94+ [ "*" , "default" , "default" ]
95+ ]
96+ )
97+ end
98+ end
7799 end
78100 end
79101end
You can’t perform that action at this time.
0 commit comments