diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-28 20:12:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 20:12:08 -0400 |
commit | cd1e25f5d57059a50e8aeae5b640c2d282e70f96 (patch) | |
tree | c5fe7993722f72f96b2f49b1ce47e2bb99adc531 /pkg/api/handlers/compat/containers_attach.go | |
parent | e8818ced806910f8ce44939fef08f89139be4119 (diff) | |
parent | 5626c2163bff661540e1ae3a5df25f0c7e7573f6 (diff) | |
download | podman-cd1e25f5d57059a50e8aeae5b640c2d282e70f96.tar.gz podman-cd1e25f5d57059a50e8aeae5b640c2d282e70f96.tar.bz2 podman-cd1e25f5d57059a50e8aeae5b640c2d282e70f96.zip |
Merge pull request #6420 from jwhonce/wip/json
V2 verify JSON output is consistent and doesn't drift
Diffstat (limited to 'pkg/api/handlers/compat/containers_attach.go')
-rw-r--r-- | pkg/api/handlers/compat/containers_attach.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/containers_attach.go b/pkg/api/handlers/compat/containers_attach.go index 012e20daf..990140ee1 100644 --- a/pkg/api/handlers/compat/containers_attach.go +++ b/pkg/api/handlers/compat/containers_attach.go @@ -90,7 +90,7 @@ func AttachContainer(w http.ResponseWriter, r *http.Request) { // For Docker compatibility, we need to re-initialize containers in these states. if state == define.ContainerStateConfigured || state == define.ContainerStateExited { if err := ctr.Init(r.Context()); err != nil { - utils.InternalServerError(w, errors.Wrapf(err, "error preparing container %s for attach", ctr.ID())) + utils.Error(w, "Container in wrong state", http.StatusConflict, errors.Wrapf(err, "error preparing container %s for attach", ctr.ID())) return } } else if !(state == define.ContainerStateCreated || state == define.ContainerStateRunning) { |