Skip to content

Commit a8426ed

Browse files
authored
Merge pull request containerd#1609 from crosbymichael/attach-docs
Add docs around multiple attach
2 parents 6c3f393 + bbb01ee commit a8426ed

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

container.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ type Container interface {
3232
//
3333
// If IOAttach options are passed the client will reattach to the IO for the running
3434
// task. If no task exists for the container a NotFound error is returned
35+
//
36+
// Clients must make sure that only one reader is attached to the task and consuming
37+
// the output from the task's fifos
3538
Task(context.Context, IOAttach) (Task, error)
3639
// Image returns the image that the container is based on
3740
Image(context.Context) (Image, error)

io.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ func (c *cio) Close() error {
6868
type IOCreation func(id string) (IO, error)
6969

7070
// IOAttach allows callers to reattach to running tasks
71+
//
72+
// There should only be one reader for a task's IO set
73+
// because fifo's can only be read from one reader or the output
74+
// will be sent only to the first reads
7175
type IOAttach func(*FIFOSet) (IO, error)
7276

7377
// NewIO returns an IOCreation that will provide IO sets without a terminal

0 commit comments

Comments
 (0)