Add DeleteProcess API for removing execs
We need a separate API for handing the exit status and deletion of Exec'd processes to make sure they are properly cleaned up within the shim and daemon. Fixes #973 Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -158,6 +158,19 @@ func (c *Task) Checkpoint(ctx context.Context, opts plugin.CheckpointOpts) error
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Task) DeleteProcess(ctx context.Context, pid uint32) (*plugin.Exit, error) {
|
||||
r, err := c.shim.DeleteProcess(ctx, &shim.DeleteProcessRequest{
|
||||
Pid: pid,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &plugin.Exit{
|
||||
Status: r.ExitStatus,
|
||||
Timestamp: r.ExitedAt,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type Process struct {
|
||||
pid int
|
||||
c *Task
|
||||
|
||||
Reference in New Issue
Block a user