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

Commit 0ab75d2

Browse files
committed
don't report error resizing tty, as container could stop any time
see https://github.com/docker/cli/blob/04dad42c3c82733c3c82b1f859829d62d8608128/cli/command/container/tty.go#L71 wich always return nil Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 597598c commit 0ab75d2

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

local/compose/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (s *composeService) Exec(ctx context.Context, project *types.Project, opts
8383
defer resp.Close()
8484

8585
if opts.Tty {
86-
err := s.monitorTTySize(ctx, exec.ID, s.apiClient.ContainerExecResize)
86+
s.monitorTTySize(ctx, exec.ID, s.apiClient.ContainerExecResize)
8787
if err != nil {
8888
return err
8989
}

local/compose/resize.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ import (
2828
"github.com/docker/docker/pkg/signal"
2929
)
3030

31-
func (s *composeService) monitorTTySize(ctx context.Context, container string, resize func(context.Context, string, moby.ResizeOptions) error) error {
31+
func (s *composeService) monitorTTySize(ctx context.Context, container string, resize func(context.Context, string, moby.ResizeOptions) error) {
3232
err := resize(ctx, container, moby.ResizeOptions{ // nolint:errcheck
3333
Height: uint(goterm.Height()),
3434
Width: uint(goterm.Width()),
3535
})
3636
if err != nil {
37-
return err
37+
return
3838
}
3939

4040
sigchan := make(chan os.Signal, 1)
@@ -71,5 +71,4 @@ func (s *composeService) monitorTTySize(ctx context.Context, container string, r
7171
}
7272
}
7373
}()
74-
return nil
7574
}

local/compose/run.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
9696
return 0, err
9797
}
9898

99-
err = s.monitorTTySize(ctx, containerID, s.apiClient.ContainerResize)
100-
if err != nil {
101-
return 0, err
102-
}
99+
s.monitorTTySize(ctx, containerID, s.apiClient.ContainerResize)
103100

104101
select {
105102
case status := <-statusC:

0 commit comments

Comments
 (0)