Add ability to signal container not just processes
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
11
update.go
11
update.go
@@ -25,5 +25,16 @@ func (h *UpdateEvent) Handle(e *Event) error {
|
||||
return ErrUnknownContainerStatus
|
||||
}
|
||||
}
|
||||
if e.Signal != nil {
|
||||
// signal the pid1/main process of the container
|
||||
processes, err := container.Processes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(processes) == 0 {
|
||||
return ErrProcessNotFound
|
||||
}
|
||||
return processes[0].Signal(e.Signal)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user