summaryrefslogtreecommitdiff
path: root/libpod/events.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/events.go')
-rw-r--r--libpod/events.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/libpod/events.go b/libpod/events.go
index 021b3b53c..bb50df92d 100644
--- a/libpod/events.go
+++ b/libpod/events.go
@@ -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)
}