Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 9af5ea4

Browse files
committed
run ContainerWait in background so we catch container exit
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 8347556 commit 9af5ea4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

local/compose/attach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (s *composeService) attach(ctx context.Context, project *types.Project, lis
8383
s.attachContainer(ctx, container, listener, project) // nolint: errcheck
8484
delete(crashed, event.Container)
8585

86-
s.waitContainer(ctx, container, listener)
86+
s.waitContainer(container, listener)
8787
}
8888
return nil
8989
},

local/compose/start.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ func (s *composeService) Start(ctx context.Context, project *types.Project, opti
5151
for _, c := range containers {
5252
c := c
5353
go func() {
54-
s.waitContainer(ctx, c, options.Attach)
54+
s.waitContainer(c, options.Attach)
5555
}()
5656
}
5757
return nil
5858
}
5959

60-
func (s *composeService) waitContainer(ctx context.Context, c moby.Container, listener compose.ContainerEventListener) {
61-
statusC, errC := s.apiClient.ContainerWait(ctx, c.ID, container.WaitConditionNotRunning)
60+
func (s *composeService) waitContainer(c moby.Container, listener compose.ContainerEventListener) {
61+
statusC, errC := s.apiClient.ContainerWait(context.Background(), c.ID, container.WaitConditionNotRunning)
6262
name := getContainerNameWithoutProject(c)
6363
select {
6464
case status := <-statusC:

0 commit comments

Comments
 (0)