Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions jobs/cloud_controller_ng/spec
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ provides:
- cc.default_app_ssh_access
- cc.default_health_check_timeout
- cc.default_stack
- cc.default_app_lifecycle
- cc.disable_private_domain_cross_space_context_path_route_sharing
- cc.droplets.blobstore_type
- cc.droplets.cdn.key_pair_id
Expand Down Expand Up @@ -848,6 +849,10 @@ properties:
default: false
description: "Disable external (i.e. git) buildpacks? (Admin buildpacks and system buildpacks only.)"

cc.default_app_lifecycle:
default: buildpack
decription: "The default buildpack lifecycle for apps. Valid values are 'buildpack' (Classic Buildpacks) and 'cnb' (Cloud Native Buildpacks)"

cc.broker_client_timeout_seconds:
default: 60
description: "For requests to service brokers, this is the HTTP (open and read) timeout setting."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ internal_route_vip_range: <%= internal_vip_range %>

threadpool_size: <%= p("cc.experimental.thin_server.thread_pool_size") %>

default_app_lifecycle: buildpack
default_app_lifecycle: <%= p("cc.default_app_lifecycle") %>
custom_metric_tag_prefix_list: <%= p("cc.custom_metric_tag_prefix_list") %>
update_metric_tags_on_rename: <%= p("cc.update_metric_tags_on_rename") %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,6 @@ app_log_revision: <%= link("cloud_controller_internal").p("cc.app_log_revision")

publish_metrics: <%= p("cc.publish_metrics") %>
prometheus_port: <%= p("cc.prometheus_port") %>

default_app_lifecycle: <%= link("cloud_controller_internal").p("cc.default_app_lifecycle") %>
directories:
tmpdir: <%= p("cc.directories.tmpdir") %>
tmpdir: <%= p("cc.directories.tmpdir") %>
31 changes: 31 additions & 0 deletions spec/cloud_controller_ng/cloud_controller_ng_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,37 @@ module Test
end
end
end

describe 'default_app_lifecycle' do
context 'when it is not set' do
it 'does not render into the config' do
template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links))
expect(template_hash['default_app_lifecycle']).to eq('buildpack')
end
end

context 'when it is set to buidpack' do
before do
merged_manifest_properties['cc']['default_app_lifecycle'] = 'buidpack'
end

it 'renders it as buidpack' do
template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links))
expect(template_hash['default_app_lifecycle']).to eq('buidpack')
end
end

context 'when it is set to true' do
before do
merged_manifest_properties['cc']['default_app_lifecycle'] = 'cnb'
end

it 'renders it as true' do
template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links))
expect(template_hash['default_app_lifecycle']).to eq('cnb')
end
end
end
end
end
end
Expand Down
10 changes: 9 additions & 1 deletion spec/cloud_controller_worker/cloud_controller_worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ module Test
'temporary_enable_v2' => false,
'packages' => {
'max_valid_packages_stored' => 5
}
},
'default_app_lifecycle' => 'cnb'
}
}
end
Expand Down Expand Up @@ -344,6 +345,13 @@ module Test
end
end
end

describe 'default_app_lifecycle' do
it 'is set from cloud_controller_internal_link' do
template_hash = YAML.safe_load(template.render(manifest_properties, consumes: links))
expect(template_hash['default_app_lifecycle']).to eq('cnb')
end
end
end
end
end
Expand Down