mirror of
https://github.com/containers/podman.git
synced 2025-09-09 17:42:22 +08:00
Merge pull request #10610 from cdoern/healthCheck
Edited compat handling code for containers/json status and added python tests
This commit is contained in:
@ -403,6 +403,24 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
|
||||
state.Status = define.ContainerStateCreated.String()
|
||||
}
|
||||
|
||||
state.Health = &types.Health{
|
||||
Status: inspect.State.Healthcheck.Status,
|
||||
FailingStreak: inspect.State.Healthcheck.FailingStreak,
|
||||
}
|
||||
|
||||
log := inspect.State.Healthcheck.Log
|
||||
|
||||
for _, item := range log {
|
||||
res := &types.HealthcheckResult{}
|
||||
s, _ := time.Parse(time.RFC3339Nano, item.Start)
|
||||
e, _ := time.Parse(time.RFC3339Nano, item.End)
|
||||
res.Start = s
|
||||
res.End = e
|
||||
res.ExitCode = item.ExitCode
|
||||
res.Output = item.Output
|
||||
state.Health.Log = append(state.Health.Log, res)
|
||||
}
|
||||
|
||||
formatCapabilities(inspect.HostConfig.CapDrop)
|
||||
formatCapabilities(inspect.HostConfig.CapAdd)
|
||||
|
||||
|
Reference in New Issue
Block a user