update containerd for refactor
fix #423 Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/cio"
|
||||
"github.com/golang/glog"
|
||||
|
||||
cioutil "github.com/kubernetes-incubator/cri-containerd/pkg/ioutil"
|
||||
@@ -39,7 +39,7 @@ func streamKey(id, name string, stream StreamType) string {
|
||||
type ContainerIO struct {
|
||||
id string
|
||||
|
||||
fifos *containerd.FIFOSet
|
||||
fifos *cio.FIFOSet
|
||||
*stdioPipes
|
||||
|
||||
stdoutGroup *cioutil.WriterGroup
|
||||
@@ -48,7 +48,7 @@ type ContainerIO struct {
|
||||
closer *wgCloser
|
||||
}
|
||||
|
||||
var _ containerd.IO = &ContainerIO{}
|
||||
var _ cio.IO = &ContainerIO{}
|
||||
|
||||
// ContainerIOOpts sets specific information to newly created ContainerIO.
|
||||
type ContainerIOOpts func(*ContainerIO) error
|
||||
@@ -71,7 +71,7 @@ func WithOutput(name string, stdout, stderr io.WriteCloser) ContainerIOOpts {
|
||||
}
|
||||
|
||||
// WithFIFOs specifies existing fifos for the container io.
|
||||
func WithFIFOs(fifos *containerd.FIFOSet) ContainerIOOpts {
|
||||
func WithFIFOs(fifos *cio.FIFOSet) ContainerIOOpts {
|
||||
return func(c *ContainerIO) error {
|
||||
c.fifos = fifos
|
||||
return nil
|
||||
@@ -115,8 +115,8 @@ func NewContainerIO(id string, opts ...ContainerIOOpts) (_ *ContainerIO, err err
|
||||
}
|
||||
|
||||
// Config returns io config.
|
||||
func (c *ContainerIO) Config() containerd.IOConfig {
|
||||
return containerd.IOConfig{
|
||||
func (c *ContainerIO) Config() cio.Config {
|
||||
return cio.Config{
|
||||
Terminal: c.fifos.Terminal,
|
||||
Stdin: c.fifos.In,
|
||||
Stdout: c.fifos.Out,
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/cio"
|
||||
"github.com/golang/glog"
|
||||
|
||||
cioutil "github.com/kubernetes-incubator/cri-containerd/pkg/ioutil"
|
||||
@@ -30,12 +30,12 @@ import (
|
||||
// ExecIO holds the exec io.
|
||||
type ExecIO struct {
|
||||
id string
|
||||
fifos *containerd.FIFOSet
|
||||
fifos *cio.FIFOSet
|
||||
*stdioPipes
|
||||
closer *wgCloser
|
||||
}
|
||||
|
||||
var _ containerd.IO = &ExecIO{}
|
||||
var _ cio.IO = &ExecIO{}
|
||||
|
||||
// NewExecIO creates exec io.
|
||||
func NewExecIO(id, root string, tty, stdin bool) (*ExecIO, error) {
|
||||
@@ -56,8 +56,8 @@ func NewExecIO(id, root string, tty, stdin bool) (*ExecIO, error) {
|
||||
}
|
||||
|
||||
// Config returns io config.
|
||||
func (e *ExecIO) Config() containerd.IOConfig {
|
||||
return containerd.IOConfig{
|
||||
func (e *ExecIO) Config() cio.Config {
|
||||
return cio.Config{
|
||||
Terminal: e.fifos.Terminal,
|
||||
Stdin: e.fifos.In,
|
||||
Stdout: e.fifos.Out,
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/cio"
|
||||
"github.com/containerd/fifo"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||
@@ -75,7 +75,7 @@ func (g *wgCloser) Cancel() {
|
||||
}
|
||||
|
||||
// newFifos creates fifos directory for a container.
|
||||
func newFifos(root, id string, tty, stdin bool) (*containerd.FIFOSet, error) {
|
||||
func newFifos(root, id string, tty, stdin bool) (*cio.FIFOSet, error) {
|
||||
root = filepath.Join(root, "io")
|
||||
if err := os.MkdirAll(root, 0700); err != nil {
|
||||
return nil, err
|
||||
@@ -84,7 +84,7 @@ func newFifos(root, id string, tty, stdin bool) (*containerd.FIFOSet, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fifos := &containerd.FIFOSet{
|
||||
fifos := &cio.FIFOSet{
|
||||
Dir: dir,
|
||||
In: filepath.Join(dir, id+"-stdin"),
|
||||
Out: filepath.Join(dir, id+"-stdout"),
|
||||
@@ -104,7 +104,7 @@ type stdioPipes struct {
|
||||
}
|
||||
|
||||
// newStdioPipes creates actual fifos for stdio.
|
||||
func newStdioPipes(fifos *containerd.FIFOSet) (_ *stdioPipes, _ *wgCloser, err error) {
|
||||
func newStdioPipes(fifos *cio.FIFOSet) (_ *stdioPipes, _ *wgCloser, err error) {
|
||||
var (
|
||||
f io.ReadWriteCloser
|
||||
set []io.Closer
|
||||
|
||||
Reference in New Issue
Block a user