Skip to content

Commit b4ce4e3

Browse files
committed
feat: Prepare next release cycle (4.1.0)
1 parent 1a78654 commit b4ce4e3

File tree

10 files changed

+5
-61
lines changed

10 files changed

+5
-61
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<PackageId>$(AssemblyName)</PackageId>
5-
<Version>4.0.0</Version>
5+
<Version>4.1.0</Version>
66
<AssemblyVersion>$(Version)</AssemblyVersion>
77
<FileVersion>$(Version)</FileVersion>
88
<Product>Testcontainers</Product>

src/Testcontainers/Builders/ImageFromDockerfileBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public override IFutureDockerImage Build()
112112
/// <inheritdoc />
113113
protected sealed override ImageFromDockerfileBuilder Init()
114114
{
115-
return base.Init().WithImageBuildPolicy(PullPolicy.Always).WithDockerfile("Dockerfile").WithDockerfileDirectory(Directory.GetCurrentDirectory()).WithName(new DockerImage("localhost/testcontainers", Guid.NewGuid().ToString("D"), string.Empty));
115+
return base.Init().WithImageBuildPolicy(PullPolicy.Always).WithDockerfile("Dockerfile").WithDockerfileDirectory(Directory.GetCurrentDirectory()).WithName(new DockerImage(string.Join("/", "localhost", "testcontainers", Guid.NewGuid().ToString("D"))));
116116
}
117117

118118
/// <inheritdoc />

src/Testcontainers/Images/DockerImage.cs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,6 @@ public DockerImage(string image)
5151
{
5252
}
5353

54-
/// <summary>
55-
/// Initializes a new instance of the <see cref="DockerImage" /> class.
56-
/// </summary>
57-
/// <param name="repository">The repository.</param>
58-
/// <param name="name">The name.</param>
59-
[Obsolete("We will remove this construct and replace it with a more efficient implementation. Please use 'DockerImage(string, string = null, string = null, string = null, string = null)' instead. All arguments except for 'repository' (the first) are optional.")]
60-
public DockerImage(string repository, string name)
61-
: this(string.Join("/", repository, name).Trim('/'))
62-
{
63-
}
64-
65-
/// <summary>
66-
/// Initializes a new instance of the <see cref="DockerImage" /> class.
67-
/// </summary>
68-
/// <param name="repository">The repository.</param>
69-
/// <param name="name">The name.</param>
70-
/// <param name="tag">The tag.</param>
71-
[Obsolete("We will remove this construct and replace it with a more efficient implementation. Please use 'DockerImage(string, string = null, string = null, string = null, string = null)' instead. All arguments except for 'repository' (the first) are optional.")]
72-
public DockerImage(string repository, string name, string tag)
73-
: this(string.Join("/", repository, name).Trim('/') + (":" + tag).TrimEnd(':'))
74-
{
75-
}
76-
7754
/// <summary>
7855
/// Initializes a new instance of the <see cref="DockerImage" /> class.
7956
/// </summary>
@@ -128,10 +105,6 @@ public string FullName
128105
}
129106
}
130107

131-
/// <inheritdoc />
132-
[Obsolete("We will remove this property, it does not follow the DSL. Use the 'Repository' property instead.")]
133-
public string Name => GetBackwardsCompatibleName();
134-
135108
/// <inheritdoc />
136109
public string GetHostname()
137110
{
@@ -174,13 +147,6 @@ public bool MatchVersion(Predicate<Version> predicate)
174147
return predicate(new Version(int.Parse(versionMatch.Groups[1].Value, NumberStyles.None), 0));
175148
}
176149

177-
private string GetBackwardsCompatibleName()
178-
{
179-
// The last index will never be a `/`, we trim it in the constructor.
180-
var lastIndex = _repository.LastIndexOf('/');
181-
return lastIndex == -1 ? _repository : _repository.Substring(lastIndex + 1);
182-
}
183-
184150
private static string TrimOrDefault(string value, string defaultValue = null)
185151
{
186152
return string.IsNullOrEmpty(value) ? defaultValue : value.Trim(TrimChars);

src/Testcontainers/Images/FutureDockerImage.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@ public string FullName
7878
}
7979
}
8080

81-
/// <inheritdoc />
82-
public string Name
83-
{
84-
get
85-
{
86-
ThrowIfResourceNotFound();
87-
return _configuration.Image.Name;
88-
}
89-
}
90-
9181
/// <inheritdoc />
9282
public string GetHostname()
9383
{

src/Testcontainers/Images/IImage.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ public interface IImage
4242
[NotNull]
4343
string FullName { get; }
4444

45-
/// <summary>
46-
/// Gets the name.
47-
/// </summary>
48-
[NotNull]
49-
[Obsolete("We will remove this property, it does not follow the DSL. Use the 'Repository' property instead.")]
50-
string Name { get; }
51-
5245
/// <summary>
5346
/// Gets the registry hostname.
5447
/// </summary>

tests/Testcontainers.Tests/Fixtures/Containers/Unix/ProtectDockerDaemonSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public abstract class ProtectDockerDaemonSocket : IAsyncLifetime
2626
protected ProtectDockerDaemonSocket(ContainerBuilder containerConfiguration, string dockerImageVersion)
2727
{
2828
_container = containerConfiguration
29-
.WithImage(new DockerImage(string.Empty, "docker", dockerImageVersion + "-dind"))
29+
.WithImage(new DockerImage("docker", null, dockerImageVersion + "-dind"))
3030
.WithPrivileged(true)
3131
.WithPortBinding(TlsPort, true)
3232
.WithBindMount(_hostCertsDirectoryPath, _containerCertsDirectoryPath, AccessMode.ReadWrite)

tests/Testcontainers.Tests/Fixtures/Images/HealthCheckFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public sealed class HealthCheckFixture : IImage, IAsyncLifetime
2525

2626
public string FullName => _image.FullName;
2727

28-
public string Name => _image.Name;
29-
3028
public string GetHostname()
3129
{
3230
return _image.GetHostname();

tests/Testcontainers.Tests/Unit/Configurations/ResourcePropertiesTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ await Task.CompletedTask
103103
Assert.Throws<InvalidOperationException>(() => image.Tag);
104104
Assert.Throws<InvalidOperationException>(() => image.Digest);
105105
Assert.Throws<InvalidOperationException>(() => image.FullName);
106-
Assert.Throws<InvalidOperationException>(() => image.Name);
107106
Assert.Throws<InvalidOperationException>(() => image.GetHostname());
108107
}
109108

tests/Testcontainers.Tests/Unit/Images/ImageFromDockerfileTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ public async Task ThrowsDockerfileDirectoryDoesNotExist()
107107
public async Task BuildsDockerImage(string dockerfile)
108108
{
109109
// Given
110-
IImage tag1 = new DockerImage("localhost/testcontainers", Guid.NewGuid().ToString("D"), string.Empty);
110+
IImage tag1 = new DockerImage(new DockerImage(string.Join("/", "localhost", "testcontainers", Guid.NewGuid().ToString("D"))));
111111

112-
IImage tag2 = new DockerImage("localhost/testcontainers", Guid.NewGuid().ToString("D"), string.Empty);
112+
IImage tag2 = new DockerImage(new DockerImage(string.Join("/", "localhost", "testcontainers", Guid.NewGuid().ToString("D"))));
113113

114114
var imageFromDockerfileBuilder = new ImageFromDockerfileBuilder()
115115
.WithName(tag1)
@@ -132,7 +132,6 @@ await imageFromDockerfileBuilder.CreateAsync()
132132
Assert.NotNull(imageFromDockerfileBuilder.Repository);
133133
Assert.NotNull(imageFromDockerfileBuilder.Tag);
134134
Assert.NotNull(imageFromDockerfileBuilder.FullName);
135-
Assert.NotNull(imageFromDockerfileBuilder.Name);
136135
Assert.Null(imageFromDockerfileBuilder.GetHostname());
137136
}
138137
}

tests/Testcontainers.Tests/Unit/Images/TestcontainersImageTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public void WhenImageNameGetsAssigned(DockerImageFixtureSerializable serializabl
6666
Assert.Equal(expected.Tag, actual.Tag);
6767
Assert.Equal(expected.Digest, actual.Digest);
6868
Assert.Equal(expected.FullName, actual.FullName);
69-
Assert.Equal(expected.Name, actual.Name);
7069
Assert.Equal(fullName, actual.FullName);
7170
}
7271

0 commit comments

Comments
 (0)