Skip to content

Commit 4f06568

Browse files
author
Joseph Palermo
committed
Fix #2341: Bosh fails to properly record runtime config tags as deployed
We were properly applying tags from runtime configs, but not properly recording that the runtime config was used as part of the deployment. This meant the next deploy would detect the tags as a change, and update the tags again. [#180420267]
1 parent 4475155 commit 4f06568

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/bosh-director/lib/bosh/director/deployment_plan/planner_factory.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def parse_from_manifest(manifest, cloud_config_consolidator, runtime_configs, op
103103
parsed_runtime_config = RuntimeConfig::RuntimeManifestParser.new(@logger, variables_spec_parser).parse(variables_interpolator.interpolate_runtime_manifest(runtime_config.raw_manifest, name))
104104
runtime_config_applies = false
105105

106+
runtime_config_applies = true if parsed_runtime_config.addons.empty?
107+
106108
parsed_runtime_config.get_applicable_releases(deployment).each do |release|
107109
runtime_config_applies = true
108110
release.add_to_deployment(deployment)

src/bosh-director/spec/unit/deployment_plan/planner_factory_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,15 @@ module DeploymentPlan
328328
end
329329

330330
context 'runtime config' do
331+
context 'when the runtime config has tags' do
332+
let(:runtime_config_hash) { { 'releases' => [], 'tags' => { 'tag_name' => 'tag_value' } } }
333+
334+
it 'includes the runtime config' do
335+
expect(planner.runtime_configs.length).to equal(1)
336+
expect(planner.runtime_configs.first.content).to include('tag_name')
337+
end
338+
end
339+
331340
context "when the version of a release is 'latest'" do
332341
let(:runtime_config_hash) { Bosh::Spec::Deployments.simple_runtime_config(release = 'bosh-release', version = 'latest') }
333342

0 commit comments

Comments
 (0)