Move events from shim into linux runtime
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ package linux
|
||||
import (
|
||||
"context"
|
||||
|
||||
eventsapi "github.com/containerd/containerd/api/services/events/v1"
|
||||
"github.com/containerd/containerd/api/types/task"
|
||||
"github.com/containerd/containerd/errdefs"
|
||||
shim "github.com/containerd/containerd/linux/shim/v1"
|
||||
@@ -96,12 +97,17 @@ func (p *Process) CloseIO(ctx context.Context) error {
|
||||
|
||||
// Start the process
|
||||
func (p *Process) Start(ctx context.Context) error {
|
||||
_, err := p.t.shim.Start(ctx, &shim.StartRequest{
|
||||
r, err := p.t.shim.Start(ctx, &shim.StartRequest{
|
||||
ID: p.id,
|
||||
})
|
||||
if err != nil {
|
||||
return errdefs.FromGRPC(err)
|
||||
}
|
||||
p.t.events.Publish(ctx, runtime.TaskExecStartedEventTopic, &eventsapi.TaskExecStarted{
|
||||
ContainerID: p.t.id,
|
||||
Pid: r.Pid,
|
||||
ExecID: p.id,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user