Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support stemcell name property #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions jobs/broker/spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions jobs/broker/templates/broker.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/broker_config_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down