Add annotations to task update request api

Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
This commit is contained in:
Kathryn Baldauf
2020-10-22 15:35:09 -07:00
parent ba8377590d
commit 95ba6e9f75
11 changed files with 566 additions and 179 deletions

View File

@@ -503,6 +503,8 @@ func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointTaskOpts) (Imag
type UpdateTaskInfo struct {
// Resources updates a tasks resource constraints
Resources interface{}
// Annotations allows arbitrary and/or experimental resource constraints for task update
Annotations map[string]string
}
// UpdateTaskOpts allows a caller to update task settings
@@ -525,6 +527,9 @@ func (t *task) Update(ctx context.Context, opts ...UpdateTaskOpts) error {
}
request.Resources = any
}
if i.Annotations != nil {
request.Annotations = i.Annotations
}
_, err := t.client.TaskService().Update(ctx, request)
return errdefs.FromGRPC(err)
}