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:
@@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -85,3 +86,13 @@ func openShimLog(ctx context.Context, bundle *Bundle) (io.ReadCloser, error) {
|
||||
}()
|
||||
return dpc, nil
|
||||
}
|
||||
|
||||
func checkCopyShimLogError(ctx context.Context, err error) error {
|
||||
// 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)) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user