Update containerd daemon

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2018-05-31 17:03:28 -07:00
parent 52ed3e0896
commit a0009345f5
No known key found for this signature in database
GPG key ID: F58C5D0A4405ACDB
3 changed files with 21 additions and 5 deletions

View file

@ -4,7 +4,7 @@
# containerd is also pinned in vendor.conf. When updating the binary
# version you may also need to update the vendor version to pick up bug
# fixes or new APIs.
CONTAINERD_COMMIT=773c489c9c1b21a6d78b5c538cd395416ec50f88 # v1.0.3
CONTAINERD_COMMIT=395068d2b7256518259816ae19e45824b15da071 # v1.1.1-rc.0
install_containerd() {
echo "Install containerd version $CONTAINERD_COMMIT"

View file

@ -294,7 +294,8 @@ func (c *client) Start(ctx context.Context, id, checkpointDir string, withStdin
t, err = ctr.ctr.NewTask(ctx,
func(id string) (cio.IO, error) {
fifos := newFIFOSet(ctr.bundleDir, InitProcessName, withStdin, spec.Process.Terminal)
rio, err = c.createIO(fifos, id, InitProcessName, stdinCloseSync, attachStdio)
rio, err = c.createIO(fifos, id, InitProcessName, stdinCloseSync, attachStdio, spec.Process.Terminal)
return rio, err
},
func(_ context.Context, _ *containerd.Client, info *containerd.TaskInfo) error {
@ -365,7 +366,7 @@ func (c *client) Exec(ctx context.Context, containerID, processID string, spec *
}()
p, err = t.Exec(ctx, processID, spec, func(id string) (cio.IO, error) {
rio, err = c.createIO(fifos, containerID, processID, stdinCloseSync, attachStdio)
rio, err = c.createIO(fifos, containerID, processID, stdinCloseSync, attachStdio, spec.Terminal)
return rio, err
})
if err != nil {
@ -644,8 +645,16 @@ func (c *client) getProcess(containerID, processID string) (containerd.Process,
// createIO creates the io to be used by a process
// This needs to get a pointer to interface as upon closure the process may not have yet been registered
func (c *client) createIO(fifos *cio.FIFOSet, containerID, processID string, stdinCloseSync chan struct{}, attachStdio StdioCallback) (cio.IO, error) {
io, err := cio.NewDirectIO(context.Background(), fifos)
func (c *client) createIO(fifos *cio.FIFOSet, containerID, processID string, stdinCloseSync chan struct{}, attachStdio StdioCallback, terminal bool) (cio.IO, error) {
var (
io *cio.DirectIO
err error
)
if terminal {
io, err = cio.NewDirectIOWithTerminal(context.Background(), fifos)
} else {
io, err = cio.NewDirectIO(context.Background(), fifos)
}
if err != nil {
return nil, err
}

View file

@ -6,6 +6,7 @@ import (
"syscall"
"time"
"github.com/containerd/containerd/defaults"
"github.com/docker/docker/pkg/system"
)
@ -18,6 +19,12 @@ func (r *remote) setDefaults() {
if r.GRPC.Address == "" {
r.GRPC.Address = filepath.Join(r.stateDir, sockFile)
}
if r.GRPC.MaxRecvMsgSize == 0 {
r.GRPC.MaxRecvMsgSize = defaults.DefaultMaxRecvMsgSize
}
if r.GRPC.MaxSendMsgSize == 0 {
r.GRPC.MaxSendMsgSize = defaults.DefaultMaxSendMsgSize
}
if r.Debug.Address == "" {
r.Debug.Address = filepath.Join(r.stateDir, debugSockFile)
}