diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2a8d7c603..484b1c7dd1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -236,7 +236,7 @@ It’s important to describe the change in plain English for the reviewer to ver Solve only one problem per patch. If your description starts to get long, that’s a sign that you probably need to split up your patch. -If the patch fixes a logged bug entry, refer to that bug entry by number and URL. +If the patch fixes a logged bug entry, refer to that bug entry by number or URL. If the patch follows from a mailing list discussion, give a URL to the mailing list archive. Please format these lines as `Fixes:` followed by the URL or, for Github bugs, the bug number preceded by a #. For example: diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index 6eb9092061..596248e43b 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -463,9 +463,20 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*container.InspectResp state.Running = true } - // Dockers created state is our configured state - if state.Status == define.ContainerStateCreated.String() { - state.Status = define.ContainerStateConfigured.String() + // map our statuses to Docker's statuses + switch state.Status { + case define.ContainerStateConfigured.String(), define.ContainerStateCreated.String(): + state.Status = "created" + case define.ContainerStateRunning.String(), define.ContainerStateStopping.String(): + state.Status = "running" + case define.ContainerStatePaused.String(): + state.Status = "paused" + case define.ContainerStateRemoving.String(): + state.Status = "removing" + case define.ContainerStateStopped.String(), define.ContainerStateExited.String(): + state.Status = "exited" + default: + state.Status = "" // unknown state } if l.HasHealthCheck() && state.Status != "created" { diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index 3dce2367b5..94ff485050 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -698,7 +698,7 @@ t GET containers/status-test/json 200 .State.Status="running" podman stop status-test & sleep 1 -t GET containers/status-test/json 200 .State.Status="stopping" +t GET containers/status-test/json 200 .State.Status="running" sleep 3 t GET containers/status-test/json 200 .State.Status="exited"