Skip to content

Commit

Permalink
Remove unused ignore_cloud_config: option
Browse files Browse the repository at this point in the history
This option is not used in produciton code and the capability to
"ignoring cloud config when `networks` are present" was removed on
[May 21, 2019](1be5ead)
  • Loading branch information
aramprice committed Aug 16, 2024
1 parent a08818a commit dd43a3b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
3 changes: 0 additions & 3 deletions src/bosh-director/lib/bosh/director/manifest/manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ def filter_releases_array(releases, applicable_releases)

def self.load_manifest(manifest_hash, manifest_text, cloud_config, runtime_config, options = {})
resolve_interpolation = options.fetch(:resolve_interpolation, true)
ignore_cloud_config = options.fetch(:ignore_cloud_config, false)

cloud_config = nil if ignore_cloud_config

cloud_config_hash = cloud_config.raw_manifest if cloud_config
runtime_config_hash = runtime_config.raw_manifest
Expand Down
25 changes: 1 addition & 24 deletions src/bosh-director/spec/unit/manifest/manifest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,34 +72,18 @@ module Bosh::Director
expect(result.runtime_config_hash).to eq('my_runtime' => 'foo_value')
end

it 'ignores cloud config when ignore_cloud_config is true' do
result = Manifest.load_from_model(deployment_model, ignore_cloud_config: true)
expect(result.manifest_hash).to eq('name' => 'a_deployment', 'name-1' => 'my-name-1')
expect(result.manifest_text).to eq(manifest_text)
expect(result.cloud_config_hash).to eq(nil)
expect(result.runtime_config_hash).to eq('my_runtime' => 'foo_value')
end

context 'when empty manifests exist' do
before do
allow(deployment_model).to receive(:manifest).and_return(nil)
allow(deployment_model).to receive(:manifest_text).and_return(nil)
allow(deployment_model).to receive(:cloud_configs).and_return([cloud_config])
allow(deployment_model).to receive(:runtime_configs).and_return([])
allow(Bosh::Director::RuntimeConfig::RuntimeConfigsConsolidator).to receive(:new).with([]).and_return(consolidated_runtime_config)
args = []

allow(consolidated_runtime_config).to receive(:raw_manifest).and_return({})
allow(consolidated_runtime_config).to receive(:interpolate_manifest_for_deployment).and_return({})
allow(variables_interpolator).to receive(:interpolate_deployment_manifest).and_return({})
end

it 'creates a manifest object from a manifest, a cloud config, and a runtime config correctly' do
result = Manifest.load_from_model(deployment_model, ignore_cloud_config: false)
expect(result.manifest_hash).to eq({})
expect(result.manifest_text).to eq('{}')
expect(result.cloud_config_hash).to eq(cloud_config.raw_manifest)
expect(result.runtime_config_hash).to eq({})
end
end

context 'when resolving manifest' do
Expand Down Expand Up @@ -166,13 +150,6 @@ module Bosh::Director
).to eq(manifest_object.to_yaml)
end

it 'ignores cloud config when ignore_cloud_config is true' do
result = Manifest.load_from_hash(manifest_hash, YAML.dump(manifest_hash), [cloud_config], runtime_configs, ignore_cloud_config: true)
expect(result.manifest_hash).to eq({})
expect(result.cloud_config_hash).to eq(nil)
expect(result.runtime_config_hash).to eq(runtime_config_hash)
end

context 'when resolving manifest' do
let(:passed_in_manifest_hash) do
{ 'smurf' => '((smurf_placeholder))' }
Expand Down

0 comments on commit dd43a3b

Please sign in to comment.