Enhance logging driver and ctr tasks to support windows

Signed-off-by: Maksim An <maksiman@microsoft.com>
This commit is contained in:
Maksim An
2020-11-20 00:55:54 -08:00
committed by Maksim An
parent 83f8d6126b
commit ddb5e1651a
4 changed files with 170 additions and 43 deletions

View File

@@ -18,6 +18,7 @@ package tasks
import (
gocontext "context"
"net/url"
"time"
"github.com/containerd/console"
@@ -67,6 +68,12 @@ func NewTask(ctx gocontext.Context, client *containerd.Client, container contain
ioCreator = cio.NewCreator(append([]cio.Opt{cio.WithStreams(con, con, nil), cio.WithTerminal}, ioOpts...)...)
} else if nullIO {
ioCreator = cio.NullIO
} else if logURI != "" {
u, err := url.Parse(logURI)
if err != nil {
return nil, err
}
ioCreator = cio.LogURI(u)
} else {
ioCreator = cio.NewCreator(append([]cio.Opt{cio.WithStdio}, ioOpts...)...)
}