summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-14 03:12:52 -0400
committerGitHub <noreply@github.com>2022-04-14 03:12:52 -0400
commit6254719b109e15ead4e57a4e3a30f78ad79cc3de (patch)
tree2cd3f0327bc0958b98495dfd88097d68d651e606 /pkg
parent480bc83b804467086e0878653d87bf51a4791980 (diff)
parent02b7eeff62224333a6ec768998a6b5db8cd7dc4d (diff)
downloadpodman-6254719b109e15ead4e57a4e3a30f78ad79cc3de.tar.gz
podman-6254719b109e15ead4e57a4e3a30f78ad79cc3de.tar.bz2
podman-6254719b109e15ead4e57a4e3a30f78ad79cc3de.zip
Merge pull request #13863 from mheon/stopped_can_attach
Allow HTTP attach to stopped containers
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/containers_attach.go2
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 027dadaa3..c8905808f 100644
--- a/pkg/api/handlers/compat/containers_attach.go
+++ b/pkg/api/handlers/compat/containers_attach.go
@@ -83,7 +83,7 @@ func AttachContainer(w http.ResponseWriter, r *http.Request) {
return
}
// For Docker compatibility, we need to re-initialize containers in these states.
- if state == define.ContainerStateConfigured || state == define.ContainerStateExited {
+ if state == define.ContainerStateConfigured || state == define.ContainerStateExited || state == define.ContainerStateStopped {
if err := ctr.Init(r.Context(), ctr.PodID() != ""); err != nil {
utils.Error(w, http.StatusConflict, errors.Wrapf(err, "error preparing container %s for attach", ctr.ID()))
return