From 04bdcc7b65ac03eeca9b14608a12067e1205081b Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Fri, 22 Jun 2018 14:30:33 -0700 Subject: runsc: Enable waiting on individual containers within a sandbox. PiperOrigin-RevId: 201742160 Change-Id: Ia9fa1442287c5f9e1196fb117c41536a80f6bb31 --- runsc/sandbox/sandbox.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runsc/sandbox/sandbox.go') diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go index 870a0ccd3..ed2c40e57 100644 --- a/runsc/sandbox/sandbox.go +++ b/runsc/sandbox/sandbox.go @@ -99,7 +99,7 @@ func (s *Sandbox) StartRoot(spec *specs.Spec, conf *boot.Config) error { // Send a message to the sandbox control server to start the root // container. - if err := conn.Call(boot.RootContainerStart, nil, nil); err != nil { + if err := conn.Call(boot.RootContainerStart, &s.ID, nil); err != nil { return fmt.Errorf("error starting root container %v: %v", spec.Process.Args, err) } @@ -107,7 +107,7 @@ func (s *Sandbox) StartRoot(spec *specs.Spec, conf *boot.Config) error { } // Start starts running a non-root container inside the sandbox. -func (s *Sandbox) Start(spec *specs.Spec, conf *boot.Config) error { +func (s *Sandbox) Start(spec *specs.Spec, conf *boot.Config, cid string) error { log.Debugf("Start non-root container sandbox %q, pid: %d", s.ID, s.Pid) conn, err := s.connect() if err != nil { @@ -118,6 +118,7 @@ func (s *Sandbox) Start(spec *specs.Spec, conf *boot.Config) error { args := boot.StartArgs{ Spec: spec, Conf: conf, + CID: cid, } if err := conn.Call(boot.ContainerStart, args, nil); err != nil { return fmt.Errorf("error starting non-root container %v: %v", spec.Process.Args, err) -- cgit v1.2.3