Browse code

Update containerd daemon

Signed-off-by: Derek McGowan <derek@mcgstyle.net>

Derek McGowan authored on 2018/06/01 09:03:28
Showing 3 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 # containerd is also pinned in vendor.conf. When updating the binary
5 5
 # version you may also need to update the vendor version to pick up bug
6 6
 # fixes or new APIs.
7
-CONTAINERD_COMMIT=773c489c9c1b21a6d78b5c538cd395416ec50f88 # v1.0.3
7
+CONTAINERD_COMMIT=395068d2b7256518259816ae19e45824b15da071 # v1.1.1-rc.0
8 8
 
9 9
 install_containerd() {
10 10
 	echo "Install containerd version $CONTAINERD_COMMIT"
... ...
@@ -294,7 +294,8 @@ func (c *client) Start(ctx context.Context, id, checkpointDir string, withStdin
294 294
 	t, err = ctr.ctr.NewTask(ctx,
295 295
 		func(id string) (cio.IO, error) {
296 296
 			fifos := newFIFOSet(ctr.bundleDir, InitProcessName, withStdin, spec.Process.Terminal)
297
-			rio, err = c.createIO(fifos, id, InitProcessName, stdinCloseSync, attachStdio)
297
+
298
+			rio, err = c.createIO(fifos, id, InitProcessName, stdinCloseSync, attachStdio, spec.Process.Terminal)
298 299
 			return rio, err
299 300
 		},
300 301
 		func(_ context.Context, _ *containerd.Client, info *containerd.TaskInfo) error {
... ...
@@ -365,7 +366,7 @@ func (c *client) Exec(ctx context.Context, containerID, processID string, spec *
365 365
 	}()
366 366
 
367 367
 	p, err = t.Exec(ctx, processID, spec, func(id string) (cio.IO, error) {
368
-		rio, err = c.createIO(fifos, containerID, processID, stdinCloseSync, attachStdio)
368
+		rio, err = c.createIO(fifos, containerID, processID, stdinCloseSync, attachStdio, spec.Terminal)
369 369
 		return rio, err
370 370
 	})
371 371
 	if err != nil {
... ...
@@ -644,8 +645,16 @@ func (c *client) getProcess(containerID, processID string) (containerd.Process,
644 644
 
645 645
 // createIO creates the io to be used by a process
646 646
 // This needs to get a pointer to interface as upon closure the process may not have yet been registered
647
-func (c *client) createIO(fifos *cio.FIFOSet, containerID, processID string, stdinCloseSync chan struct{}, attachStdio StdioCallback) (cio.IO, error) {
648
-	io, err := cio.NewDirectIO(context.Background(), fifos)
647
+func (c *client) createIO(fifos *cio.FIFOSet, containerID, processID string, stdinCloseSync chan struct{}, attachStdio StdioCallback, terminal bool) (cio.IO, error) {
648
+	var (
649
+		io  *cio.DirectIO
650
+		err error
651
+	)
652
+	if terminal {
653
+		io, err = cio.NewDirectIOWithTerminal(context.Background(), fifos)
654
+	} else {
655
+		io, err = cio.NewDirectIO(context.Background(), fifos)
656
+	}
649 657
 	if err != nil {
650 658
 		return nil, err
651 659
 	}
... ...
@@ -6,6 +6,7 @@ import (
6 6
 	"syscall"
7 7
 	"time"
8 8
 
9
+	"github.com/containerd/containerd/defaults"
9 10
 	"github.com/docker/docker/pkg/system"
10 11
 )
11 12
 
... ...
@@ -18,6 +19,12 @@ func (r *remote) setDefaults() {
18 18
 	if r.GRPC.Address == "" {
19 19
 		r.GRPC.Address = filepath.Join(r.stateDir, sockFile)
20 20
 	}
21
+	if r.GRPC.MaxRecvMsgSize == 0 {
22
+		r.GRPC.MaxRecvMsgSize = defaults.DefaultMaxRecvMsgSize
23
+	}
24
+	if r.GRPC.MaxSendMsgSize == 0 {
25
+		r.GRPC.MaxSendMsgSize = defaults.DefaultMaxSendMsgSize
26
+	}
21 27
 	if r.Debug.Address == "" {
22 28
 		r.Debug.Address = filepath.Join(r.stateDir, debugSockFile)
23 29
 	}