Skip to content

Commit

Permalink
fix image selection
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Apr 15, 2024
1 parent f3a4861 commit c94b94e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CloudController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ public async Task<string> CreateNewRunner(string arch, string size, string runne
string name = $"ghr-{NameGenerator.Identifiers.Get(separator: "-")}".ToLower();

_logger.LogInformation($"Creating VM {name} from image {imageName} of size {size}");

string htzArch = "x86";
if (arch == "arm64")
{
htzArch = "arm";
}

// Grab image
var images = await _client.Image.Get();
long? imageId = images.FirstOrDefault(x => x.Description == imageName)?.Id;
long? imageId = images.FirstOrDefault(x => x.Description == imageName && x.Architecture == htzArch)?.Id;

if (!imageId.HasValue)
{
Expand Down

0 comments on commit c94b94e

Please sign in to comment.