Ignore fifo error when using v2 multi-container shim
When using a multi-container shim, the fifo of the 2nd to Nth container will not be opened when the ctx is done. This will cause an `ErrReadClosed` that can be ignored. Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
This commit is contained in:
@@ -85,13 +85,10 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
|
||||
// copy the shim's logs to containerd's output
|
||||
go func() {
|
||||
defer f.Close()
|
||||
if _, err := io.Copy(os.Stderr, f); err != nil {
|
||||
// When using a multi-container shim the 2nd to Nth container in the
|
||||
// shim will not have a separate log pipe. Ignore the failure log
|
||||
// message here when the shim connect times out.
|
||||
if !os.IsNotExist(errors.Cause(err)) {
|
||||
log.G(ctx).WithError(err).Error("copy shim log")
|
||||
}
|
||||
_, err := io.Copy(os.Stderr, f)
|
||||
err = checkCopyShimLogError(ctx, err)
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Error("copy shim log")
|
||||
}
|
||||
}()
|
||||
out, err := cmd.CombinedOutput()
|
||||
|
||||
Reference in New Issue
Block a user