mirror of
https://github.com/docker/compose.git
synced 2026-02-09 01:59:22 +08:00
refactor(attach): remove unused detach watcher and keep attach behavior
Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
This commit is contained in:
committed by
Nicolas De loof
parent
2672d34217
commit
abd99be4fd
@@ -53,7 +53,6 @@ func (s *composeService) attach(ctx context.Context, project *types.Project, lis
|
||||
_, err = fmt.Fprintf(s.stdout(), "Attaching to %s\n", strings.Join(names, ", "))
|
||||
if err != nil {
|
||||
logrus.Debugf("failed to write attach message: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, ctr := range containers {
|
||||
@@ -96,17 +95,12 @@ func (s *composeService) doAttachContainer(ctx context.Context, service, id, nam
|
||||
})
|
||||
})
|
||||
|
||||
restore, detached, err := s.attachContainerStreams(ctx, id, inspect.Config.Tty, nil, wOut, wErr)
|
||||
restore, _, err := s.attachContainerStreams(ctx, id, inspect.Config.Tty, nil, wOut, wErr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer restore()
|
||||
|
||||
go func() {
|
||||
<-detached
|
||||
logrus.Debugf("detached from container %s", name)
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user