Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pkg/compose/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ func (c *monitor) Start(ctx context.Context) error {
listener(newContainerEvent(event.TimeNano, ctr, api.ContainerEventRestarted))
}
logrus.Debugf("container %s restarted", ctr.Name)
case events.ActionStop:
// when a container is in restarting phase, and we stop the application (abort-on-container-exit)
// we won't get any additional start+die events, just this stop as a proof container is down
logrus.Debugf("container %s stopped", ctr.Name)
containers.Remove(ctr.ID)
case events.ActionDie:
logrus.Debugf("container %s exited with code %d", ctr.Name, ctr.ExitCode)
inspect, err := c.api.ContainerInspect(ctx, event.Actor.ID)
Expand Down
6 changes: 5 additions & 1 deletion pkg/compose/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func newLogPrinter(consumer api.LogConsumer) logPrinter {
func (p *printer) HandleEvent(event api.ContainerEvent) {
switch event.Type {
case api.ContainerEventExited:
p.consumer.Status(event.Source, fmt.Sprintf("exited with code %d", event.ExitCode))
if event.Restarting {
p.consumer.Status(event.Source, fmt.Sprintf("exited with code %d (restarting)", event.ExitCode))
} else {
p.consumer.Status(event.Source, fmt.Sprintf("exited with code %d", event.ExitCode))
}
case api.ContainerEventRecreated:
p.consumer.Status(event.Container.Labels[api.ContainerReplaceLabel], "has been recreated")
case api.ContainerEventLog, api.HookEventLog:
Expand Down
2 changes: 1 addition & 1 deletion pkg/compose/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, options
if event.Type != api.ContainerEventStarted {
return
}
if slices.Contains(attached, event.ID) {
if slices.Contains(attached, event.ID) && !event.Restarting {
return
}
eg.Go(func() error {
Expand Down