runtime: ignore file-already-closed error if dead shim

fix: #5130

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu
2021-03-12 15:37:07 +08:00
parent d8208e2e37
commit eabd9b98b6
3 changed files with 12 additions and 12 deletions

View File

@@ -20,6 +20,7 @@ package v2
import (
"context"
"os"
"testing"
"github.com/containerd/fifo"
@@ -43,6 +44,9 @@ func TestCheckCopyShimLogError(t *testing.T) {
if err := checkCopyShimLogError(ctx, nil); err != nil {
t.Fatalf("should return the actual error after context is done, but %v", err)
}
if err := checkCopyShimLogError(ctx, os.ErrClosed); err != nil {
t.Fatalf("should return the actual error after context is done, but %v", err)
}
if err := checkCopyShimLogError(ctx, fifo.ErrRdFrmWRONLY); err != fifo.ErrRdFrmWRONLY {
t.Fatalf("should return the actual error after context is done, but %v", err)
}