Merge pull request #14705 from jakecorrenti/show-health-status-event

Show Health Status events
This commit is contained in:
openshift-ci[bot]
2022-06-27 17:49:27 +00:00
committed by GitHub
9 changed files with 81 additions and 10 deletions

View File

@ -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)
}