mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
Merge pull request #14705 from jakecorrenti/show-health-status-event
Show Health Status events
This commit is contained in:
@ -33,6 +33,16 @@ func (c *Container) newContainerEvent(status events.Status) {
|
||||
Attributes: c.Labels(),
|
||||
}
|
||||
|
||||
// if the current event is a HealthStatus event, we need to get the current
|
||||
// status of the container to pass to the event
|
||||
if status == events.HealthStatus {
|
||||
containerHealthStatus, err := c.healthCheckStatus()
|
||||
if err != nil {
|
||||
e.HealthStatus = fmt.Sprintf("%v", err)
|
||||
}
|
||||
e.HealthStatus = containerHealthStatus
|
||||
}
|
||||
|
||||
if err := c.runtime.eventer.Write(e); err != nil {
|
||||
logrus.Errorf("Unable to write pod event: %q", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user