Merge pull request #28854 from coolljt0725/igore_close_stderr_error

Ignore "failed to close stdin" if container or process not found
This commit is contained in:
Sebastiaan van Stijn 2016-11-30 10:23:27 +01:00 committed by GitHub
commit f9ddac3f3c
2 changed files with 5 additions and 1 deletions

View File

@ -135,7 +135,7 @@ func (c *Config) CopyToPipe(iop libcontainerd.IOPipe) {
go func() {
pools.Copy(iop.Stdin, stdin)
if err := iop.Stdin.Close(); err != nil {
logrus.Errorf("failed to close stdin: %+v", err)
logrus.Warnf("failed to close stdin: %+v", err)
}
}()
}

View File

@ -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
}