Add events support in client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
10
exit.go
10
exit.go
@@ -6,10 +6,6 @@ type ExitEvent struct {
|
||||
s *Supervisor
|
||||
}
|
||||
|
||||
type ExecExitEvent struct {
|
||||
s *Supervisor
|
||||
}
|
||||
|
||||
func (h *ExitEvent) Handle(e *Event) error {
|
||||
logrus.WithFields(logrus.Fields{"pid": e.Pid, "status": e.Status}).
|
||||
Debug("containerd: process exited")
|
||||
@@ -34,10 +30,16 @@ func (h *ExitEvent) Handle(e *Event) error {
|
||||
container.SetExited(e.Status)
|
||||
ne := NewEvent(DeleteEventType)
|
||||
ne.ID = container.ID()
|
||||
ne.Pid = e.Pid
|
||||
ne.Status = e.Status
|
||||
h.s.SendEvent(ne)
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExecExitEvent struct {
|
||||
s *Supervisor
|
||||
}
|
||||
|
||||
func (h *ExecExitEvent) Handle(e *Event) error {
|
||||
// exec process: we remove this process without notifying the main event loop
|
||||
container := h.s.processes[e.Pid]
|
||||
|
Reference in New Issue
Block a user