Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jobs/haproxy/templates/haproxy.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ listen stats
acl private src <%= p("ha_proxy.trusted_stats_cidrs") %>
http-request deny unless private
mode http
<%- if_p("ha_proxy.stats_promex_enable") do -%>
<%- if p("ha_proxy.stats_promex_enable") -%>
http-request use-service prometheus-exporter if { path <%= p("ha_proxy.stats_promex_path") %> }
<%- end -%>
stats enable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
end
end

context 'when ha_proxy.stats_promex_enable is false (default)' do
it 'does not include a prometheus exporter endpoint' do
expect(stats_listener).not_to include(a_string_including('prometheus-exporter'))
end
end

context 'when ha_proxy.trusted_stats_cidrs is set' do
let(:properties) do
default_properties.merge({ 'trusted_stats_cidrs' => '1.2.3.4/32' })
Expand Down