Skip to content

Commit 8bbd201

Browse files
committed
Address some review questions
1 parent 53a8b6c commit 8bbd201

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Microsoft.NET.Build.Containers/Registry.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ public record struct ManifestConfig(string mediaType, long size, string digest);
2020
public record struct ManifestLayer(string mediaType, long size, string digest, string[]? urls);
2121
public record struct ManifestV2(int schemaVersion, string tag, string mediaType, ManifestConfig config, List<ManifestLayer> layers);
2222

23-
// not a complete list, only the subset that we support
24-
// public enum GoOS { linux, windows };
25-
// not a complete list, only the subset that we support
26-
// public enum GoArch { amd64, arm , arm64, [JsonStringEnumMember("386")] x386 };
2723
public record struct PlatformInformation(string architecture, string os, string? variant, string[] features, [property:JsonPropertyName("os.version")][field: JsonPropertyName("os.version")] string? version);
2824
public record struct PlatformSpecificManifest(string mediaType, long size, string digest, PlatformInformation platform);
2925
public record struct ManifestListV2(int schemaVersion, string mediaType, PlatformSpecificManifest[] manifests);
@@ -170,7 +166,10 @@ async Task<HttpResponseMessage> GetBlob(string repositoryName, string digest)
170166
}
171167

172168
private string? CreateRidForPlatform(PlatformInformation platform)
173-
{
169+
{
170+
// we only support linux and windows containers explicitly, so anything else we should skip past.
171+
// there are theoretically other platforms/architectures that Docker supports (s390x?), but we are
172+
// deliberately ignoring them without clear user signal.
174173
var osPart = platform.os switch
175174
{
176175
"linux" => "linux",

Test.Microsoft.NET.Build.Containers.Filesystem/RegistryTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public async Task GetFromRegistry()
1818
// TODO: The DOTNET_ROOT comes from the test host, but we have no idea what the SDK version is.
1919
var ridgraphfile = Path.Combine(Environment.GetEnvironmentVariable("DOTNET_ROOT"), "sdk", "7.0.100", "RuntimeIdentifierGraph.json");
2020

21-
Image downloadedImage = await registry.GetImageManifest(DockerRegistryManager.BaseImage, DockerRegistryManager.Net6ImageTag, "linux-x64", ridgraphfile); // don't need rid graph for local registry
21+
// Don't need rid graph for local registry image pulls - since we're only pushing single image manifests (not manifest lists)
22+
// as part of our setup, we could put literally anything in here. The file at the passed-in path would only get read when parsing manifests lists.
23+
Image downloadedImage = await registry.GetImageManifest(DockerRegistryManager.BaseImage, DockerRegistryManager.Net6ImageTag, "linux-x64", ridgraphfile);
2224

2325
Assert.IsNotNull(downloadedImage);
2426
}

0 commit comments

Comments
 (0)