lib/bosh/stemcell/builder_options.rb in bosh-stemcell-1.2175.0 vs lib/bosh/stemcell/builder_options.rb in bosh-stemcell-1.2200.0

- old
+ new

@@ -6,17 +6,18 @@ module Bosh::Stemcell class BuilderOptions extend Forwardable - def initialize(env, definition, version, tarball, disk_size = nil) - @environment = env - @definition = definition + def initialize(dependencies = {}) + @environment = dependencies.fetch(:env) + @definition = dependencies.fetch(:definition) - @stemcell_version = version - @image_create_disk_size = disk_size || infrastructure.default_disk_size - @bosh_micro_release_tgz_path = tarball + @stemcell_version = dependencies.fetch(:version) + @image_create_disk_size = dependencies.fetch(:disk_size, infrastructure.default_disk_size) + @bosh_micro_release_tgz_path = dependencies.fetch(:release_tarball) + @os_image_tgz_path = dependencies.fetch(:os_image_tarball) end def default stemcell_name = "bosh-#{infrastructure.name}-#{infrastructure.hypervisor}-#{operating_system.name}" stemcell_name += "-#{agent.name}_agent" unless agent.name == 'ruby' @@ -32,11 +33,12 @@ 'bosh_protocol_version' => Bosh::Agent::BOSH_PROTOCOL, 'ruby_bin' => ruby_bin, 'bosh_release_src_dir' => File.join(source_root, 'release/src/bosh'), 'bosh_agent_src_dir' => File.join(source_root, 'bosh_agent'), 'go_agent_src_dir' => File.join(source_root, 'go_agent'), - 'image_create_disk_size' => image_create_disk_size + 'image_create_disk_size' => image_create_disk_size, + 'os_image_tgz' => os_image_tgz_path, }.merge(bosh_micro_options).merge(environment_variables).merge(ovf_options) end private @@ -50,10 +52,11 @@ attr_reader( :environment, :stemcell_version, :definition, :image_create_disk_size, - :bosh_micro_release_tgz_path + :bosh_micro_release_tgz_path, + :os_image_tgz_path, ) def ovf_options if infrastructure.name == 'vsphere' || infrastructure.name == 'vcloud' { 'image_ovftool_path' => environment['OVFTOOL'] }