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:
@@ -192,6 +192,16 @@ func (t *Task) DeleteProcess(ctx context.Context, pid uint32) (*plugin.Exit, err
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (t *Task) Update(ctx context.Context, resources []byte) error {
|
||||
_, err := t.shim.Update(ctx, &shim.UpdateTaskRequest{
|
||||
Resources: &protobuf.Any{
|
||||
TypeUrl: specs.Version,
|
||||
Value: resources,
|
||||
},
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
type Process struct {
|
||||
pid int
|
||||
t *Task
|
||||
|
Reference in New Issue
Block a user