drivers/mock: implement InspectTask

This commit is contained in:
Michael Schurter 2019-05-08 13:58:16 -07:00
parent d7e5ace1ed
commit 8589233a0e
1 changed files with 7 additions and 1 deletions

View File

@ -555,7 +555,13 @@ func (d *Driver) DestroyTask(taskID string, force bool) error {
}
func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error) {
panic("not implemented")
h, ok := d.tasks.Get(taskID)
if !ok {
return nil, drivers.ErrTaskNotFound
}
return h.TaskStatus(), nil
}
func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error) {