Skip to content

Commit

Permalink
chore(#601): Update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Oct 10, 2022
1 parent c48d858 commit 0a3d1c1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- 565 Add `ExecScriptAsync` (MongoDB Shell) to MongoDB module
- 583 Add XML documentation to NuGet
- 594 Add `IDockerContainer.GetLogs`
- 601 Add `ITestcontainersBuilder<TDockerContainer>.WithImagePullPolicy` (@BenasB)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Keep in mind to enable the correct Docker engine on Windows host systems to matc
To configure a container, use the `TestcontainersBuilder<TestcontainersContainer>` builder, that provides:

- `WithImage` specifies an `IMAGE[:TAG]` to derive the container from.
- `WithImagePullPolicy` specifies an image pull policy used to determine if the image should be pulled when starting the container e. g. `--pull "always"|"missing"|"never"`.
- `WithImagePullPolicy` specifies an image pull policy to determine when an image is pulled e.g. `--pull "always"|"missing"|"never"`.
- `WithWorkingDirectory` specifies and overrides the `WORKDIR` for the instruction sets.
- `WithEntrypoint` specifies and overrides the `ENTRYPOINT` that will run as an executable.
- `WithCommand` specifies and overrides the `COMMAND` instruction provided from the Dockerfile.
Expand Down
5 changes: 3 additions & 2 deletions src/Testcontainers/Builders/ITestcontainersBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ public interface ITestcontainersBuilder<out TDockerContainer> : IAbstractBuilder
ITestcontainersBuilder<TDockerContainer> WithImage(IDockerImage image);

/// <summary>
/// Sets the image pull policy, which is used to determine if the image should be pulled before starting the container.
/// Sets the image pull policy of the Testcontainer.
/// </summary>
/// <param name="imagePullPolicy">The image pull policy that determines if the image should be pulled.</param>
/// <param name="imagePullPolicy">The image pull policy.</param>
/// <remarks><see cref="PullPolicy" /> has pre-configured policies. Default: <see cref="PullPolicy.Missing" />.</remarks>
/// <returns>A configured instance of <see cref="ITestcontainersBuilder{TDockerContainer}" />.</returns>
[PublicAPI]
ITestcontainersBuilder<TDockerContainer> WithImagePullPolicy(Func<ImagesListResponse, bool> imagePullPolicy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ public interface ITestcontainersConfiguration : IDockerResourceConfiguration
IDockerImage Image { get; }

/// <summary>
/// Gets the policy determining if an image should be pulled when creating the container.
/// Gets the image pull policy.
/// </summary>
/// <remarks>
/// Allows the user to decide based on the cached image (if it's possible to retrieve one).
/// </remarks>
Func<ImagesListResponse, bool> ImagePullPolicy { get; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public TestcontainersConfiguration(IDockerResourceConfiguration dockerResourceCo
/// <param name="dockerEndpointAuthenticationConfiguration">The Docker endpoint authentication configuration.</param>
/// <param name="dockerRegistryAuthenticationConfiguration">The Docker registry authentication configuration.</param>
/// <param name="image">The Docker image.</param>
/// <param name="imagePullPolicy">The Docker image pull policy.</param>
/// <param name="imagePullPolicy">The image pull policy.</param>
/// <param name="name">The name.</param>
/// <param name="hostname">The hostname.</param>
/// <param name="workingDirectory">The working directory.</param>
Expand Down
12 changes: 6 additions & 6 deletions src/Testcontainers/Images/PullPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ namespace DotNet.Testcontainers.Images
using System;
using Docker.DotNet.Models;

/// <summary>
/// Pre-configured image pull policies.
/// </summary>
public static class PullPolicy
{
/// <summary>
/// Gets the policy of never pulling the image.
/// Gets the policy that never pulls images.
/// </summary>
public static Func<ImagesListResponse, bool> Never
{
Expand All @@ -17,11 +20,8 @@ public static class PullPolicy
}

/// <summary>
/// Gets the policy of pulling the image if it's not cached.
/// Gets the policy that pulls missing images (not cached).
/// </summary>
/// <remarks>
/// This is the default behavior.
/// </remarks>
public static Func<ImagesListResponse, bool> Missing
{
get
Expand All @@ -31,7 +31,7 @@ public static class PullPolicy
}

/// <summary>
/// Gets the policy of always pulling the image.
/// Gets the policy that always pulls images.
/// </summary>
public static Func<ImagesListResponse, bool> Always
{
Expand Down

0 comments on commit 0a3d1c1

Please sign in to comment.