Implement task update

This allows tasks to have their resources updated as they are running.

Fixes #1067

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-26 16:38:49 -07:00
parent 1f478be14d
commit f36e0193a4
15 changed files with 749 additions and 152 deletions

View File

@@ -364,6 +364,16 @@ func (s *Service) ShimInfo(ctx context.Context, r *google_protobuf.Empty) (*shim
}, nil
}
func (s *Service) Update(ctx context.Context, r *shimapi.UpdateTaskRequest) (*google_protobuf.Empty, error) {
if s.initProcess == nil {
return nil, errors.New(ErrContainerNotCreated)
}
if err := s.initProcess.Update(ctx, r); err != nil {
return nil, err
}
return empty, nil
}
func (s *Service) waitExit(p process, pid int, cmd *reaper.Cmd) {
status := <-cmd.ExitCh
p.Exited(status)