Skip to content

Commit

Permalink
fix: check if the container request if for the reaper (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Oct 21, 2022
1 parent 322aa4e commit 786954c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,9 @@ func (p *DockerProvider) CreateContainer(ctx context.Context, req ContainerReque
sessionID := sessionID()

var termSignal chan bool
if !req.SkipReaper {
// the reaper does not need to start a reaper for itself
isReaperContainer := strings.EqualFold(req.Image, reaperImage(req.ReaperImage))
if !req.SkipReaper && !isReaperContainer {
r, err := NewReaper(context.WithValue(ctx, dockerHostContextKey, p.host), sessionID.String(), p, req.ReaperImage)
if err != nil {
return nil, fmt.Errorf("%w: creating reaper failed", err)
Expand All @@ -957,7 +959,7 @@ func (p *DockerProvider) CreateContainer(ctx context.Context, req ContainerReque
req.Labels[k] = v
}
}
} else {
} else if !isReaperContainer {
p.printReaperBanner("container")
}

Expand Down

0 comments on commit 786954c

Please sign in to comment.