summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-23 14:45:29 -0400
committerGitHub <noreply@github.com>2021-06-23 14:45:29 -0400
commitb0a3ac35785fca1a054d236937c86cce85631585 (patch)
treec9b5b8a72cb57ddbfb49a463564468c24f23b637 /pkg/api/handlers/compat
parent2b850ef055885bf3482f405e804fb02aef2e9895 (diff)
parent6ecdf4c389fd8e079fbfae76c11351c0301eb003 (diff)
downloadpodman-b0a3ac35785fca1a054d236937c86cce85631585.tar.gz
podman-b0a3ac35785fca1a054d236937c86cce85631585.tar.bz2
podman-b0a3ac35785fca1a054d236937c86cce85631585.zip
Merge pull request #10610 from cdoern/healthCheck
Edited compat handling code for containers/json status and added python tests
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r--pkg/api/handlers/compat/containers.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 6bc02dd2b..2a0a0b725 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -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)