Skip to content
Merged
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
4 changes: 4 additions & 0 deletions daemon/containerio/cio.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ func WithAttach(stdin io.Reader, stdout, stderr io.Writer) containerdio.Attach {
if paths == nil {
return nil, fmt.Errorf("cannot attach to existing fifos")
}
// judge stdin is initial, make logic same with copyIO.
if i, ok := stdin.(*ContainerIO); (ok && i == nil) || (stdin == nil) {
paths.In = ""
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wonder if this code is need here, code not so good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ace-Tang What did you concern about? Maybe we should use reflect.ValueOf(stdin).IsNil() to check whether stdin is nil?

cfg := containerdio.Config{
Terminal: paths.Terminal,
Stdout: paths.Out,
Expand Down