From cf63245635e10c84917ffbf2ad2a3a041d0cbb03 Mon Sep 17 00:00:00 2001 From: Laurent Rene de Cotret Date: Tue, 14 Jan 2025 14:48:41 -0500 Subject: [PATCH] Updated `since` documentation tag in preparation for 0.5.1.0 --- CHANGELOG.md | 6 ++++++ src/TestContainers/Docker.hs | 6 +++--- src/TestContainers/Docker/Internal.hs | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c0fe79..4d93f3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ * Add `fromExistingNetwork` to allow connecting containers to existing, unmanaged networks (@alexbiehl, https://github.com/testcontainers/testcontainers-hs/pull/41) +* Add `setMemory` to limit the memory of a Docker container; + +* Add `setCpus` to limit the CPUs limit of a docker container; + +* Add `fromImageId` to get an `Image` from an image id; + ## 0.5.0.0 -- 2023-02-20 * BREAKING: Refined lifecycle management. testcontainers is now using testcontainers/ryuk resource reaper to cleanup containers, networks and volumes. Release keys for containers are deprecated. (@alexbiehl, https://github.com/testcontainers/testcontainers-hs/pull/33) diff --git a/src/TestContainers/Docker.hs b/src/TestContainers/Docker.hs index b35bac9..86f6a7f 100644 --- a/src/TestContainers/Docker.hs +++ b/src/TestContainers/Docker.hs @@ -373,7 +373,7 @@ setCmd newCmd req = -- | Set the memory limit of a Docker container. This is equivalent to -- invoking @docker run@ with the @--memory@ parameter. -- --- @since x.x.x.x +-- @since 0.5.1.0 setMemory :: Text -> ContainerRequest -> ContainerRequest setMemory newMemory req = req {memory = Just newMemory} @@ -381,7 +381,7 @@ setMemory newMemory req = -- | Set the cpus limit of a Docker container. This is equivalent to -- invoking @docker run@ with the @--cpus@ parameter. -- --- @since x.x.x.x +-- @since 0.5.1.0 setCpus :: Text -> ContainerRequest -> ContainerRequest setCpus newCpus req = req {cpus = Just newCpus} @@ -762,7 +762,7 @@ fromTag tag = defaultToImage $ do -- | Get an `Image` from an image id. This doesn't run @docker pull@ or any other Docker command -- on construction. -- --- @since x.x.x.x +-- @since 0.5.1.0 fromImageId :: Text -> ToImage fromImageId imageId = defaultToImage $ diff --git a/src/TestContainers/Docker/Internal.hs b/src/TestContainers/Docker/Internal.hs index 1ca2c59..f8e753e 100644 --- a/src/TestContainers/Docker/Internal.hs +++ b/src/TestContainers/Docker/Internal.hs @@ -48,7 +48,7 @@ class WithoutReaper request where -- | Do not register the docker resource (container, register, etc.) with the resource reaper. -- Careful, doing this will make your container leak on shutdown if not explicitly stopped. -- - -- @since x.x.x + -- @since 0.5.1.0 withoutReaper :: request -> request -- | Identifies a network within the Docker runtime. Assigned by @docker network create@