diff options
author | Kevin Krakauer <krakauer@google.com> | 2018-09-17 11:30:16 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-09-17 11:31:28 -0700 |
commit | 25add7b22b1b0b6a4bac1e72536d3f3a0c70f048 (patch) | |
tree | 87b4ecb9dcf96d2de23cb54328d04650e60b502e /runsc/boot/controller.go | |
parent | de5a590ee203b4ee217da68dbec8e58a7753e520 (diff) |
runsc: Fix stdin/out/err in multi-container mode.
Stdin/out/err weren't being sent to the sentry.
PiperOrigin-RevId: 213307171
Change-Id: Ie4b634a58b1b69aa934ce8597e5cc7a47a2bcda2
Diffstat (limited to 'runsc/boot/controller.go')
-rw-r--r-- | runsc/boot/controller.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go index 69154ff23..4d41dcd6c 100644 --- a/runsc/boot/controller.go +++ b/runsc/boot/controller.go @@ -186,8 +186,10 @@ type StartArgs struct { // CID is the ID of the container to start. CID string - // FilePayload contains the file descriptor over which the sandbox will - // request files from its root filesystem. + // FilePayload contains, in order: + // * stdin, stdout, and stderr. + // * the file descriptor over which the sandbox will + // request files from its root filesystem. urpc.FilePayload } @@ -215,8 +217,8 @@ func (cm *containerManager) Start(args *StartArgs, _ *struct{}) error { if path.Clean(args.CID) != args.CID { return fmt.Errorf("container ID shouldn't contain directory traversals such as \"..\": %q", args.CID) } - if len(args.FilePayload.Files) == 0 { - return fmt.Errorf("start arguments must contain at least one file for the container root") + if len(args.FilePayload.Files) < 4 { + return fmt.Errorf("start arguments must contain stdin, stderr, and stdout followed by at least one file for the container root gofer") } err := cm.l.startContainer(cm.l.k, args.Spec, args.Conf, args.CID, args.FilePayload.Files) @@ -339,7 +341,7 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error { cm.l.k = k // Set up the restore environment. - fds := &fdDispenser{fds: cm.l.ioFDs} + fds := &fdDispenser{fds: cm.l.goferFDs} renv, err := createRestoreEnvironment(cm.l.spec, cm.l.conf, fds) if err != nil { return fmt.Errorf("error creating RestoreEnvironment: %v", err) |