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
453
453
log_format: <%= @sidekiq['log_format'] %>
454
454
<% unless @sidekiq['routing_rules'].empty? %>
455
455
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? %>
457
458
- [<%= quote(query) %> , <%= queue.nil? ? 'null' : quote(queue) %> ]
459
+ <% else %>
460
+ - [<%= quote(query) %> , <%= queue.nil? ? 'null' : quote(queue) %> , <%= quote(shard_instance) %> ]
461
+ <% end %>
458
462
<% end %>
459
463
<% end %>
460
464
Original file line number Diff line number Diff line change 74
74
)
75
75
end
76
76
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
77
99
end
78
100
end
79
101
end
You can’t perform that action at this time.
0 commit comments