فهرست منبع

Ignore "failed to close stdin" if container or process not found

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 9aedaf5b3acc0dd0df4a4b67c46cf922d42f62a3)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Lei Jitang 8 سال پیش
والد
کامیت
79f153f49e
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      libcontainerd/process_unix.go

+ 4 - 0
libcontainerd/process_unix.go

@@ -8,6 +8,7 @@ import (
 	"os"
 	"path/filepath"
 	goruntime "runtime"
+	"strings"
 	"time"
 
 	containerd "github.com/docker/containerd/api/grpc/types"
@@ -86,6 +87,9 @@ func (p *process) sendCloseStdin() error {
 		Pid:        p.friendlyName,
 		CloseStdin: true,
 	})
+	if err != nil && (strings.Contains(err.Error(), "container not found") || strings.Contains(err.Error(), "process not found")) {
+		return nil
+	}
 	return err
 }