Skip to content

Commit fb04982

Browse files
Surayya Huseyn ZadaSurayya Huseyn Zada
authored andcommitted
refactoring: make BuiltImage a class instead of a struct
1 parent 9b3fd7e commit fb04982

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Containers/Microsoft.NET.Build.Containers/BuiltImage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Microsoft.NET.Build.Containers;
66
/// <summary>
77
/// Represents constructed image ready for further processing.
88
/// </summary>
9-
internal readonly struct BuiltImage
9+
internal sealed class BuiltImage
1010
{
1111
/// <summary>
1212
/// Gets image configuration in JSON format.
@@ -46,12 +46,12 @@ internal readonly struct BuiltImage
4646
/// <summary>
4747
/// Gets image OS.
4848
/// </summary>
49-
internal string OS { get; init; }
49+
internal string? OS { get; init; }
5050

5151
/// <summary>
5252
/// Gets image architecture.
5353
/// </summary>
54-
internal string Architecture { get; init; }
54+
internal string? Architecture { get; init; }
5555

5656
/// <summary>
5757
/// Gets layers descriptors.

src/Containers/Microsoft.NET.Build.Containers/ImageIndexGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ private static (string, string) GenerateImageIndex(BuiltImage[] images, string m
7171
digest = image.ManifestDigest,
7272
platform = new PlatformInformation
7373
{
74-
architecture = image.Architecture,
75-
os = image.OS
74+
architecture = image.Architecture!,
75+
os = image.OS!
7676
}
7777
};
7878
manifests[i] = manifest;

src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ private static async Task WriteIndexJsonForMultiArchOciImage(
510510
mediaType = SchemaTypes.OciManifestV1,
511511
size = images[i].Manifest.Length,
512512
digest = images[i].ManifestDigest,
513-
platform = new PlatformInformation { architecture = images[i].Architecture, os = images[i].OS }
513+
platform = new PlatformInformation { architecture = images[i].Architecture!, os = images[i].OS! }
514514
};
515515
manifests[i] = manifest;
516516
}

0 commit comments

Comments
 (0)