execution: use provided process ID for state
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
@@ -7,22 +7,28 @@ import (
|
||||
"github.com/docker/containerd/execution"
|
||||
)
|
||||
|
||||
func newProcess(id string, pid int) (execution.Process, error) {
|
||||
func newProcess(c *execution.Container, id string, pid int) (execution.Process, error) {
|
||||
proc, err := os.FindProcess(pid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &process{
|
||||
c: c,
|
||||
id: id,
|
||||
proc: proc,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type process struct {
|
||||
c *execution.Container
|
||||
id string
|
||||
proc *os.Process
|
||||
}
|
||||
|
||||
func (p *process) Container() *execution.Container {
|
||||
return p.c
|
||||
}
|
||||
|
||||
func (p *process) ID() string {
|
||||
return p.id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user