Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ rate_limiter_v2_api:
per_process_admin_limit: <%= (p("cc.rate_limiter_v2_api.admin_limit").to_f/instances).ceil %>
reset_interval_in_minutes: <%= p("cc.rate_limiter_v2_api.reset_interval_in_minutes") %>

temporary_enable_v2: <%= p("cc.temporary_enable_v2") %>

<% unless p("cc.temporary_enable_deprecated_thin_webserver") && !p("cc.experimental.use_redis") %>
redis:
socket: "/var/vcap/data/valkey/valkey.sock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ location / {
}

<% if !p("cc.temporary_enable_v2") %>
location ~ /v2(?!/info) {
location ~ /v2/ {
return 404 "V2 endpoints disabled";
}
<% end %>
Expand Down
21 changes: 20 additions & 1 deletion spec/cloud_controller_ng/cloud_controller_ng_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ module Test
[{ 'description' => 'Cloud Foundry Linux-based filesystem',
'name' => 'cflinuxfs4' }],
'staging_upload_password' => '((cc_staging_upload_password))',
'staging_upload_user' => 'staging_user' },
'staging_upload_user' => 'staging_user',
'temporary_enable_v2' => true },
'ccdb' =>
{ 'databases' => [{ 'name' => 'cloud_controller', 'tag' => 'cc' }],
'db_scheme' => 'mysql',
Expand Down Expand Up @@ -501,6 +502,24 @@ module Test
end
end

describe 'enable v2 API' do
it 'is by default true' do
template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links))
expect(template_hash['temporary_enable_v2']).to be(true)
end

context 'when explicitly disabled' do
before do
merged_manifest_properties['cc']['temporary_enable_v2'] = false
end

it 'is false' do
template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links))
expect(template_hash['temporary_enable_v2']).to be(false)
end
end
end

context 'when db connection expiration configuration is present' do
before do
merged_manifest_properties['ccdb']['connection_expiration_timeout'] = 3600
Expand Down