diff --git a/jobs/broker/spec b/jobs/broker/spec index 89a04b9c..c4f185c6 100644 --- a/jobs/broker/spec +++ b/jobs/broker/spec @@ -217,6 +217,9 @@ properties: - os: ubuntu version: 1234 + service_deployment.stemcell.name: + description: stemcell name to use for every job in the service deployment + service_deployment.stemcell.os: description: stemcell OS to use for every job in the service deployment diff --git a/jobs/broker/templates/broker.yml.erb b/jobs/broker/templates/broker.yml.erb index 265f9617..8cd7f28b 100644 --- a/jobs/broker/templates/broker.yml.erb +++ b/jobs/broker/templates/broker.yml.erb @@ -95,6 +95,7 @@ def prepare_stemcells(service_deployment) raise 'Invalid service_deployment config - at least one stemcell must be specified' end + service_deployment['stemcells'].map! { |stemcell| stemcell.compact } service_deployment['stemcells'].each do |stemcell| validate_stemcell stemcell end diff --git a/spec/broker_config_template_spec.rb b/spec/broker_config_template_spec.rb index a6d615f9..33e7050a 100644 --- a/spec/broker_config_template_spec.rb +++ b/spec/broker_config_template_spec.rb @@ -1143,7 +1143,7 @@ generate_test_manifest do |yaml| yaml['instance_groups'][0]['jobs'][0]['properties']['service_deployment']['stemcells'] = [] yaml['instance_groups'][0]['jobs'][0]['properties']['service_deployment']['stemcell'] = { - 'os' => 'ubuntu-trusty', 'version' => 2311 + 'os' => 'ubuntu-trusty', 'version' => "2311", 'name' => 'bosh-warden-boshlite-ubuntu-trusty-go_agent', } yaml end @@ -1152,7 +1152,7 @@ it 'generates the config with "stemcells"' do obj = YAML.load(rendered_template) - expect(obj['service_deployment']['stemcells']).to eq([{"os"=>"ubuntu-trusty", "version"=>2311}]) + expect(obj['service_deployment']['stemcells']).to eq([{"os"=>"ubuntu-trusty", "version"=>"2311", "name" => "bosh-warden-boshlite-ubuntu-trusty-go_agent"}]) expect(obj['service_deployment']['stemcell']).to be_nil end