Check that process exists before it is returned
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
c07ede497d
commit
8e598fcb21
@ -282,11 +282,14 @@ func (t *Task) Update(ctx context.Context, resources *types.Any) error {
|
|||||||
|
|
||||||
// Process returns a specific process inside the task by the process id
|
// Process returns a specific process inside the task by the process id
|
||||||
func (t *Task) Process(ctx context.Context, id string) (runtime.Process, error) {
|
func (t *Task) Process(ctx context.Context, id string) (runtime.Process, error) {
|
||||||
// TODO: verify process exists for container
|
p := &Process{
|
||||||
return &Process{
|
|
||||||
id: id,
|
id: id,
|
||||||
t: t,
|
t: t,
|
||||||
}, nil
|
}
|
||||||
|
if _, err := p.State(ctx); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Metrics returns runtime specific system level metric information for the task
|
// Metrics returns runtime specific system level metric information for the task
|
||||||
|
Loading…
Reference in New Issue
Block a user