From 26b47f31ef8ec617a4a0f777b26da7f8ea2a7e79 Mon Sep 17 00:00:00 2001 From: Matthew McNew Date: Fri, 30 Dec 2022 19:38:31 -0700 Subject: [PATCH] Prevent custom reaper image from causing Ryuk warning - A custom provided ReaperImage would trigger the "Ryuk has been disabled for the container" warning when starting the Reaper image itself because the image name is used to detect if the container is the reaper container. - This passes the selected ReaperImage as the ReaperImage when creating the ContainerRequest to ensure that it matches as the reaper image. --- reaper.go | 9 +++++---- reaper_test.go | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/reaper.go b/reaper.go index a82a8ba54f..05a51f7e13 100644 --- a/reaper.go +++ b/reaper.go @@ -65,10 +65,11 @@ func NewReaper(ctx context.Context, sessionID string, provider ReaperProvider, r Labels: map[string]string{ TestcontainerLabelIsReaper: "true", }, - SkipReaper: true, - Mounts: Mounts(BindMount(dockerHost, "/var/run/docker.sock")), - AutoRemove: true, - WaitingFor: wait.ForListeningPort(listeningPort), + SkipReaper: true, + Mounts: Mounts(BindMount(dockerHost, "/var/run/docker.sock")), + AutoRemove: true, + WaitingFor: wait.ForListeningPort(listeningPort), + ReaperImage: reaperImage(reaperImageName), } // include reaper-specific labels to the reaper container diff --git a/reaper_test.go b/reaper_test.go index fd22fff377..8420e840c9 100644 --- a/reaper_test.go +++ b/reaper_test.go @@ -44,6 +44,7 @@ func createContainerRequest(customize func(ContainerRequest) ContainerRequest) C AutoRemove: true, WaitingFor: wait.ForListeningPort(nat.Port("8080/tcp")), NetworkMode: "bridge", + ReaperImage: "reaperImage", } if customize == nil { return req