Skip to content

Commit

Permalink
Merge pull request #331 from cloudfoundry/max_total_results-param
Browse files Browse the repository at this point in the history
Add optional cc `max_total_results` parameter
  • Loading branch information
FloThinksPi authored Jul 27, 2023
2 parents b419daa + 110e280 commit a9f053f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jobs/cloud_controller_ng/spec
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,8 @@ properties:
cc.renderer.max_inline_relations_depth:
description: "Maximum depth of inlined relationships in the result"
default: 2
cc.renderer.max_total_results:
description: "Maximum number of total results (page * per_page)"

uaa.clients.cc_service_broker_client.secret:
description: "(DEPRECATED) - Used for generating SSO clients for service brokers"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ renderer:
max_results_per_page: <%= p("cc.renderer.max_results_per_page") %>
default_results_per_page: <%= p("cc.renderer.default_results_per_page") %>
max_inline_relations_depth: <%= p("cc.renderer.max_inline_relations_depth") %>
<% if_p("cc.renderer.max_total_results") do |max_total_results| %>
max_total_results: <%= max_total_results %>
<% end %>
<% if_p("uaa.clients.cc_service_broker_client.secret") do %>
uaa_client_name: "cc_service_broker_client"
Expand Down
17 changes: 17 additions & 0 deletions spec/cloud_controller_ng/cloud_controller_ng_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,23 @@ module Test
end
end
end

describe 'max_total_results' do
context "when 'cc.renderer.max_total_results' is set" do
it 'renders max_total_results into the ccng config' do
merged_manifest_properties['cc'].store('renderer', { 'max_total_results' => 1000 })
template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links))
expect(template_hash['renderer']['max_total_results']).to eq(1000)
end
end

context "when 'cc.renderer.max_total_results' is not set (default)" do
it 'does not render max_total_results into the ccng config' do
template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links))
expect(template_hash['renderer']).not_to have_key(:max_total_results)
end
end
end
end
end
end
Expand Down

0 comments on commit a9f053f

Please sign in to comment.