Commit 9e060313 authored by Matthew Warton's avatar Matthew Warton Committed by Commit Bot

Crostini: Allow an alternate crostini image server url to be specified

This will be used for loading specific container images during automated
testing.  This allows the images to be loaded using the same code paths
in lxd and other system components rather than the current approach
which is quite different from the way that users actually install
Crostini.

Design proposal at https://docs.google.com/document/d/1-T0tpU9szQxXVHtK_qXXG6JYjiQazQAQ28sIz8WNt_Q/edit#heading=h.5irk4csrpu0y

Bug: None
Change-Id: Ib4753fd1e4fd33b3207f0624e1325ffc7a742b7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135095Reviewed-by: default avatarNic Hollingum <hollingum@google.com>
Commit-Queue: Matthew Warton <mwarton@google.com>
Cr-Commit-Position: refs/heads/master@{#756555}
parent 847f1bdd
......@@ -1352,7 +1352,17 @@ void CrostiniManager::CreateLxdContainer(std::string vm_name,
request.set_vm_name(std::move(vm_name));
request.set_container_name(std::move(container_name));
request.set_owner_id(owner_id_);
request.set_image_server(kCrostiniDefaultImageServerUrl);
std::string image_server_url;
auto* cros_component_manager =
g_browser_process->platform_part()->cros_component_manager();
if (cros_component_manager) {
image_server_url = cros_component_manager
->GetCompatiblePath("cros-crostini-image-server-url")
.value();
}
request.set_image_server(image_server_url.empty()
? kCrostiniDefaultImageServerUrl
: image_server_url);
if (base::FeatureList::IsEnabled(
chromeos::features::kCrostiniUseBusterImage)) {
request.set_image_alias(kCrostiniBusterImageAlias);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment