Skip to content

Commit

Permalink
Merge pull request #3393 from canonical/add-missing-pollinate-package
Browse files Browse the repository at this point in the history
[daemon] Add pollinate package to internal cloud-init
  • Loading branch information
sharder996 authored and Chris Townsend committed Jan 31, 2024
1 parent 105fa25 commit 9d16707
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/daemon/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ auto make_cloud_init_vendor_config(const mp::SSHKeyProvider& key_provider, const
config["ssh_authorized_keys"].push_back(ssh_key_line);
config["timezone"] = request->time_zone();
config["system_info"]["default_user"]["name"] = username;
config["packages"].push_back("pollinate");

auto pollinate_user_agent_string =
fmt::format("multipass/version/{} # written by Multipass\n", multipass::version_string);
Expand Down Expand Up @@ -215,6 +216,15 @@ void prepare_user_data(YAML::Node& user_data_config, YAML::Node& vendor_config)
auto keys = user_data_config["ssh_authorized_keys"];
if (keys.IsSequence())
keys.push_back(vendor_config["ssh_authorized_keys"][0]);

auto packages = user_data_config["packages"];
if (packages.IsSequence())
{
for (const auto& package : vendor_config["packages"])
{
packages.push_back(package);
}
}
}

template <typename T>
Expand Down

0 comments on commit 9d16707

Please sign in to comment.