summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-28 14:07:04 +0000
committerGitHub <noreply@github.com>2022-06-28 14:07:04 +0000
commit50fa651a4e3cfde2b64aa818ad1009f4289f0afd (patch)
treebcd11013b4a2a167008614ad8319345cddf7c45f /pkg/api
parent8267cd3c514ed1e8f41a7e4b6017f11400f134aa (diff)
parentcc49146332e279644f1357c6a5e209927bd73471 (diff)
downloadpodman-50fa651a4e3cfde2b64aa818ad1009f4289f0afd.tar.gz
podman-50fa651a4e3cfde2b64aa818ad1009f4289f0afd.tar.bz2
podman-50fa651a4e3cfde2b64aa818ad1009f4289f0afd.zip
Merge pull request #14700 from shuttle-hq/bug/docker-compat-initialized
Docker compat returning unknown "initialized" for `status.status`
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/containers.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 616f0a138..411b0efe9 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -289,8 +289,10 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
return nil, err
}
stateStr := state.String()
- if stateStr == "configured" {
- stateStr = "created"
+
+ // Some docker states are not the same as ours. This makes sure the state string stays true to the Docker API
+ if state == define.ContainerStateCreated {
+ stateStr = define.ContainerStateConfigured.String()
}
switch state {
@@ -420,9 +422,9 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
state.Running = true
}
- // docker calls the configured state "created"
- if state.Status == define.ContainerStateConfigured.String() {
- state.Status = define.ContainerStateCreated.String()
+ // Dockers created state is our configured state
+ if state.Status == define.ContainerStateCreated.String() {
+ state.Status = define.ContainerStateConfigured.String()
}
if l.HasHealthCheck() && state.Status != "created" {