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:
@@ -451,6 +451,17 @@ func (s *Service) Checkpoint(ctx context.Context, r *api.CheckpointTaskRequest)
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Service) Update(ctx context.Context, r *api.UpdateTaskRequest) (*google_protobuf.Empty, error) {
|
||||
t, err := s.getTask(ctx, r.ContainerID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := t.Update(ctx, r.Resources.Value); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return empty, nil
|
||||
}
|
||||
|
||||
func (s *Service) writeContent(ctx context.Context, mediaType, ref string, r io.Reader) (*types.Descriptor, error) {
|
||||
writer, err := s.store.Writer(ctx, ref, 0, "")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user