From 2dbadf47e61f84f2df05e46f6fc0a5a8fc498f60 Mon Sep 17 00:00:00 2001 From: Philipp Thun Date: Wed, 10 Jan 2024 10:40:55 +0100 Subject: [PATCH] Add legacy_md5_buildpack_paths_enabled param Set default value to 'true' to keep the current behaviour. --- jobs/cloud_controller_ng/spec | 4 +++ .../templates/cloud_controller_ng.yml.erb | 2 ++ .../cloud_controller_ng_spec.rb | 26 ++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/jobs/cloud_controller_ng/spec b/jobs/cloud_controller_ng/spec index b2d05d8ff0..ffa27c541f 100644 --- a/jobs/cloud_controller_ng/spec +++ b/jobs/cloud_controller_ng/spec @@ -1212,3 +1212,7 @@ properties: cc.update_metric_tags_on_rename: description: "Enable sending a Desired LRP update when an app is renamed" default: true + + cc.legacy_md5_buildpack_paths_enabled: + description: "Enable legacy MD5 buildpack paths. If disabled, xxhash64 is used for calculating paths in buildpack image layers." + default: true diff --git a/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb b/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb index c8d2a7f494..f6ffa5e98f 100644 --- a/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb +++ b/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb @@ -522,3 +522,5 @@ threadpool_size: <%= p("cc.experimental.thin_server.thread_pool_size") %> default_app_lifecycle: buildpack custom_metric_tag_prefix_list: <%= p("cc.custom_metric_tag_prefix_list") %> update_metric_tags_on_rename: <%= p("cc.update_metric_tags_on_rename") %> + +legacy_md5_buildpack_paths_enabled: <%= p("cc.legacy_md5_buildpack_paths_enabled") %> diff --git a/spec/cloud_controller_ng/cloud_controller_ng_spec.rb b/spec/cloud_controller_ng/cloud_controller_ng_spec.rb index 4b94e323d9..659630338b 100644 --- a/spec/cloud_controller_ng/cloud_controller_ng_spec.rb +++ b/spec/cloud_controller_ng/cloud_controller_ng_spec.rb @@ -592,7 +592,7 @@ module Test end end - describe 'max_total_results' do + 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 }) @@ -608,6 +608,30 @@ module Test end end end + + describe 'legacy_md5_buildpack_paths_enabled' do + context 'when legacy md5 buildpack paths are enabled' do + before do + merged_manifest_properties['cc']['legacy_md5_buildpack_paths_enabled'] = true + end + + it 'renders the correct value into the ccng config' do + template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links)) + expect(template_hash['legacy_md5_buildpack_paths_enabled']).to be(true) + end + end + + context 'when legacy md5 buildpack paths are disabled' do + before do + merged_manifest_properties['cc']['legacy_md5_buildpack_paths_enabled'] = false + end + + it 'renders the correct value into the ccng config' do + template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links)) + expect(template_hash['legacy_md5_buildpack_paths_enabled']).to be(false) + end + end + end end end end