Don't send exit event on failure
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
17e4d62ab0
commit
94568b7a9b
2 changed files with 15 additions and 11 deletions
|
@ -12,6 +12,7 @@ type DeleteTask struct {
|
||||||
ID string
|
ID string
|
||||||
Status int
|
Status int
|
||||||
PID string
|
PID string
|
||||||
|
NoEvent bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Supervisor) delete(t *DeleteTask) error {
|
func (s *Supervisor) delete(t *DeleteTask) error {
|
||||||
|
@ -20,6 +21,7 @@ func (s *Supervisor) delete(t *DeleteTask) error {
|
||||||
if err := s.deleteContainer(i.container); err != nil {
|
if err := s.deleteContainer(i.container); err != nil {
|
||||||
logrus.WithField("error", err).Error("containerd: deleting container")
|
logrus.WithField("error", err).Error("containerd: deleting container")
|
||||||
}
|
}
|
||||||
|
if !t.NoEvent {
|
||||||
s.notifySubscribers(Event{
|
s.notifySubscribers(Event{
|
||||||
Type: "exit",
|
Type: "exit",
|
||||||
Timestamp: time.Now(),
|
Timestamp: time.Now(),
|
||||||
|
@ -27,6 +29,7 @@ func (s *Supervisor) delete(t *DeleteTask) error {
|
||||||
Status: t.Status,
|
Status: t.Status,
|
||||||
PID: t.PID,
|
PID: t.PID,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
ContainersCounter.Dec(1)
|
ContainersCounter.Dec(1)
|
||||||
ContainerDeleteTimer.UpdateSince(start)
|
ContainerDeleteTimer.UpdateSince(start)
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ func (w *worker) Start() {
|
||||||
t.Err <- err
|
t.Err <- err
|
||||||
evt := &DeleteTask{
|
evt := &DeleteTask{
|
||||||
ID: t.Container.ID(),
|
ID: t.Container.ID(),
|
||||||
|
NoEvent: true,
|
||||||
}
|
}
|
||||||
w.s.SendTask(evt)
|
w.s.SendTask(evt)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue