Skip to content

Commit dcb2c73

Browse files
Error when no tags are given to CreateNewImage (#241)
Fixes #240
1 parent 67cdc6c commit dcb2c73

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Microsoft.NET.Build.Containers/CreateNewImage.Interface.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ partial class CreateNewImage
4949
/// <summary>
5050
/// The tag to associate with the new image.
5151
/// </summary>
52+
[Required]
5253
public string[] ImageTags { get; set; }
5354

5455
/// <summary>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public void CreateNewImage_Baseline()
4949
task.OutputRegistry = "localhost:5010";
5050
task.PublishDirectory = Path.Combine(newProjectDir.FullName, "bin", "release", "net7.0");
5151
task.ImageName = "dotnet/testimage";
52+
task.ImageTags = new[] { "latest" };
5253
task.WorkingDirectory = "app/";
5354
task.Entrypoint = new TaskItem[] { new("dotnet"), new("build") };
5455

@@ -101,7 +102,7 @@ public void ParseContainerProperties_EndToEnd()
101102
Assert.AreEqual("6.0", pcp.ParsedContainerTag);
102103

103104
Assert.AreEqual("dotnet/testimage", pcp.NewContainerImageName);
104-
new []{ "5.0", "latest"}.SequenceEqual(pcp.NewContainerTags);
105+
CollectionAssert.AreEquivalent(new []{ "5.0", "latest"}, pcp.NewContainerTags);
105106

106107
CreateNewImage cni = new CreateNewImage();
107108
cni.BaseRegistry = pcp.ParsedContainerRegistry;

0 commit comments

Comments
 (0)