windows: Use runtime event topic constants
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
5c8e0efb63
commit
b2d9db2e17
@ -194,7 +194,8 @@ func (r *windowsRuntime) Delete(ctx context.Context, t runtime.Task) (*runtime.E
|
|||||||
wt.cleanup()
|
wt.cleanup()
|
||||||
r.tasks.Delete(ctx, t)
|
r.tasks.Delete(ctx, t)
|
||||||
|
|
||||||
r.emitter.Post(events.WithTopic(ctx, "/tasks/delete"), &eventsapi.TaskDelete{
|
r.emitter.Post(events.WithTopic(ctx, runtime.TaskDeleteEventTopic),
|
||||||
|
&eventsapi.TaskDelete{
|
||||||
ContainerID: wt.id,
|
ContainerID: wt.id,
|
||||||
Pid: wt.pid,
|
Pid: wt.pid,
|
||||||
ExitStatus: rtExit.Status,
|
ExitStatus: rtExit.Status,
|
||||||
@ -311,7 +312,8 @@ func (r *windowsRuntime) newTask(ctx context.Context, namespace, id string, spec
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
r.emitter.Post(events.WithTopic(ctx, "/tasks/create"), &eventsapi.TaskCreate{
|
r.emitter.Post(events.WithTopic(ctx, runtime.TaskCreateEventTopic),
|
||||||
|
&eventsapi.TaskCreate{
|
||||||
ContainerID: id,
|
ContainerID: id,
|
||||||
IO: &eventsapi.TaskIO{
|
IO: &eventsapi.TaskIO{
|
||||||
Stdin: io.Stdin,
|
Stdin: io.Stdin,
|
||||||
|
@ -112,7 +112,8 @@ func (t *task) Start(ctx context.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
t.emitter.Post(events.WithTopic(ctx, "/tasks/start"), &eventsapi.TaskStart{
|
t.emitter.Post(events.WithTopic(ctx, runtime.TaskStartEventTopic),
|
||||||
|
&eventsapi.TaskStart{
|
||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
Pid: t.pid,
|
Pid: t.pid,
|
||||||
})
|
})
|
||||||
@ -129,7 +130,8 @@ func (t *task) Pause(ctx context.Context) error {
|
|||||||
t.Unlock()
|
t.Unlock()
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.emitter.Post(events.WithTopic(ctx, "/tasks/paused"), &eventsapi.TaskPaused{
|
t.emitter.Post(events.WithTopic(ctx, runtime.TaskPausedEventTopic),
|
||||||
|
&eventsapi.TaskPaused{
|
||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -148,7 +150,8 @@ func (t *task) Resume(ctx context.Context) error {
|
|||||||
t.Unlock()
|
t.Unlock()
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.emitter.Post(events.WithTopic(ctx, "/tasks/resumed"), &eventsapi.TaskResumed{
|
t.emitter.Post(events.WithTopic(ctx, runtime.TaskResumedEventTopic),
|
||||||
|
&eventsapi.TaskResumed{
|
||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -192,7 +195,8 @@ func (t *task) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runt
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
t.emitter.Post(events.WithTopic(ctx, "/tasks/exec-added"), &eventsapi.TaskExecAdded{
|
t.emitter.Post(events.WithTopic(ctx, runtime.TaskExecAddedEventTopic),
|
||||||
|
&eventsapi.TaskExecAdded{
|
||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
ExecID: id,
|
ExecID: id,
|
||||||
Pid: p.Pid(),
|
Pid: p.Pid(),
|
||||||
@ -354,7 +358,8 @@ func (t *task) newProcess(ctx context.Context, id string, conf *hcsshim.ProcessC
|
|||||||
}
|
}
|
||||||
wp.exitCode = uint32(ec)
|
wp.exitCode = uint32(ec)
|
||||||
|
|
||||||
t.emitter.Post(events.WithTopic(ctx, "/tasks/exit"), &eventsapi.TaskExit{
|
t.emitter.Post(events.WithTopic(ctx, runtime.TaskExitEventTopic),
|
||||||
|
&eventsapi.TaskExit{
|
||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
ID: id,
|
ID: id,
|
||||||
Pid: pid,
|
Pid: pid,
|
||||||
|
Loading…
Reference in New Issue
Block a user