containerd/supervisor/signal.go
Michael Crosby 3dc59d565a Rename Events to task in supervisor
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 17:26:24 -08:00

22 lines
377 B
Go

package supervisor
type SignalTask struct {
s *Supervisor
}
func (h *SignalTask) Handle(e *Task) error {
i, ok := h.s.containers[e.ID]
if !ok {
return ErrContainerNotFound
}
processes, err := i.container.Processes()
if err != nil {
return err
}
for _, p := range processes {
if p.ID() == e.Pid {
return p.Signal(e.Signal)
}
}
return ErrProcessNotFound
}