Skip to content

Commit

Permalink
Prevent custom reaper image from causing Ryuk warning
Browse files Browse the repository at this point in the history
 - 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.
  • Loading branch information
matthewmcnew committed Dec 31, 2022
1 parent cc98efb commit 26b47f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions reaper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26b47f3

Please sign in to comment.