Move shim protos into linux pkg

This moves the shim's API and protos out of the containerd services
package and into the linux runtime package. This is because the shim is
an implementation detail of the linux runtime that we have and it is not
a containerd user facing api.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-22 14:29:49 -07:00
parent 6ad3ba739e
commit 990536f2cc
26 changed files with 1838 additions and 2266 deletions

View File

@@ -17,9 +17,7 @@ import (
winsys "golang.org/x/sys/windows"
)
var (
ErrLoadedContainer = errors.New("loaded container can only be terminated")
)
var ErrLoadedContainer = errors.New("loaded container can only be terminated")
type eventCallback func(id string, evType plugin.EventType, pid, exitStatus uint32, exitedAt time.Time)
@@ -160,12 +158,12 @@ func (c *container) Exec(ctx context.Context, opts plugin.ExecOpts) (plugin.Proc
return &process{p}, nil
}
func (c *container) CloseStdin(ctx context.Context, pid uint32) error {
return c.ctr.CloseStdin(ctx, pid)
func (c *container) CloseIO(ctx context.Context, pid uint32) error {
return c.ctr.CloseIO(ctx, pid)
}
func (c *container) Pty(ctx context.Context, pid uint32, size plugin.ConsoleSize) error {
return c.ctr.Pty(ctx, pid, size)
func (c *container) ResizePty(ctx context.Context, pid uint32, size plugin.ConsoleSize) error {
return c.ctr.ResizePty(ctx, pid, size)
}
func (c *container) Status() plugin.Status {

View File

@@ -199,7 +199,7 @@ func (c *Container) Stop(ctx context.Context) error {
return nil
}
func (c *Container) CloseStdin(ctx context.Context, pid uint32) error {
func (c *Container) CloseIO(ctx context.Context, pid uint32) error {
var proc *Process
c.Lock()
for _, p := range c.processes {
@@ -216,7 +216,7 @@ func (c *Container) CloseStdin(ctx context.Context, pid uint32) error {
return proc.CloseStdin()
}
func (c *Container) Pty(ctx context.Context, pid uint32, size plugin.ConsoleSize) error {
func (c *Container) ResizePty(ctx context.Context, pid uint32, size plugin.ConsoleSize) error {
var proc *Process
c.Lock()
for _, p := range c.processes {