Add cio.Load for loading io set
This adds a `Load` Opt for cio to load a tasks io/fifos without attaching or starting the copy routines. It adds the load method in `ctr` by default so that fifos or other IO are removed from disk on delete methods inbetween command runs. It is not the default for all task loads for backwards compat. and a user may want to keep io around to reuse or if log files are used. Fixes #2421 Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
11
cio/io.go
11
cio/io.go
@@ -255,3 +255,14 @@ func (l *logIO) Wait() {
|
||||
func (l *logIO) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Load the io for a container but do not attach
|
||||
//
|
||||
// Allows io to be loaded on the task for deletion without
|
||||
// starting copy routines
|
||||
func Load(set *FIFOSet) (IO, error) {
|
||||
return &cio{
|
||||
config: set.Config,
|
||||
closers: []io.Closer{set},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user