diff --git a/bosh-stemcell/lib/bosh/stemcell/stemcell_packager.rb b/bosh-stemcell/lib/bosh/stemcell/stemcell_packager.rb index 2e339caf77..428a1b525d 100644 --- a/bosh-stemcell/lib/bosh/stemcell/stemcell_packager.rb +++ b/bosh-stemcell/lib/bosh/stemcell/stemcell_packager.rb @@ -44,6 +44,7 @@ def manifest(disk_format) "sha1" => image_checksum, "operating_system" => "#{definition.operating_system.name}-#{definition.operating_system.version}", "stemcell_formats" => infrastructure.stemcell_formats, + "agent_features" => [], "cloud_properties" => manifest_cloud_properties(disk_format, infrastructure, stemcell_name) } end diff --git a/bosh-stemcell/spec/bosh/stemcell/stemcell_packager_spec.rb b/bosh-stemcell/spec/bosh/stemcell/stemcell_packager_spec.rb index a7edc31c90..e94f76a863 100644 --- a/bosh-stemcell/spec/bosh/stemcell/stemcell_packager_spec.rb +++ b/bosh-stemcell/spec/bosh/stemcell/stemcell_packager_spec.rb @@ -105,6 +105,7 @@ def additional_cloud_properties "version" => "1234", "bosh_protocol" => 1, "api_version" => 3, + "agent_features" => [], "sha1" => "c1ebdefc3f8282a9d7d47803fb5030b61ffc793d", # SHA-1 of image above "operating_system" => "ubuntu-jammy", "stemcell_formats" => ["stemcell-format-a", "stemcell-format-b"], @@ -124,6 +125,16 @@ def additional_cloud_properties }) end + it "includes the agent feature list in the packaged manifest" do + packager.package(disk_format) + + manifest = YAML.load_file(File.join(work_dir, "stemcell/stemcell.MF")) + expect(manifest["agent_features"]).to eq([]) + contents, _, status = Open3.capture3("tar", "xOf", File.join(tarball_dir, "bosh-stemcell-1234-fake_infra-fake_hypervisor-ubuntu-jammy-go_agent.tgz"), "stemcell.MF") + expect(status.success?).to be(true) + expect(YAML.safe_load(contents)["agent_features"]).to eq(manifest["agent_features"]) + end + it "returns the path of the created tarball" do expect(packager.package(disk_format)).to eq( File.join(tarball_dir, "bosh-stemcell-1234-fake_infra-fake_hypervisor-ubuntu-jammy-go_agent.tgz")