Skip to content

Commit

Permalink
Replace use of skipReaper with withoutReaper
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbiehl committed Feb 23, 2024
1 parent 172c401 commit b5b31d3
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/TestContainers/Docker.hs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,10 @@ createRyukReaper = do
ryukContainer <-
run $
containerRequest (fromTag ryukImageTag)
& skipReaper
&
-- Ryuk destroys itself once it reaped the resources,
-- no need to register itself with itself.
withoutReaper
& setVolumeMounts [(pack dockerSocketLocation, "/var/run/docker.sock")]
& setExpose [ryukPort]
& setWaitingFor (waitUntilMappedPortReachable ryukPort)
Expand All @@ -629,14 +632,6 @@ createRyukReaper = do

newRyukReaper ryukContainerAddress ryukContainerPort

-- | Internal attribute, serving as a loop breaker: When runnign a container
-- we ensure a 'Reaper' is present, since the 'Reaper' itself is a running
-- container we need to break the loop to avoid spinning up a new 'Reaper' for
-- the 'Reaper'.
skipReaper :: ContainerRequest -> ContainerRequest
skipReaper request =
request {noReaper = True}

-- | Kills a Docker container. `kill` is essentially @docker kill@.
--
-- @since 0.1.0.0
Expand Down

0 comments on commit b5b31d3

Please sign in to comment.