summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-18 11:20:19 -0400
committerGitHub <noreply@github.com>2020-06-18 11:20:19 -0400
commite6b9b3ab227729e72f52ddab94c024174ab8a442 (patch)
tree1c1e6c9bd1c595410d179b3ebf9ea868cddb587e /pkg/api/handlers
parent2e621aece054e9ba8cd2fb30254c8513e7caf1b6 (diff)
parentb20619e5b0dfa6c63b25c3fd9a7ae6188bee2b4c (diff)
downloadpodman-e6b9b3ab227729e72f52ddab94c024174ab8a442.tar.gz
podman-e6b9b3ab227729e72f52ddab94c024174ab8a442.tar.bz2
podman-e6b9b3ab227729e72f52ddab94c024174ab8a442.zip
Merge pull request #6656 from mheon/recursive_init
Allow recursive dependency start with Init()
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/compat/containers_attach.go2
-rw-r--r--pkg/api/handlers/libpod/containers.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/containers_attach.go b/pkg/api/handlers/compat/containers_attach.go
index 990140ee1..aad6e2294 100644
--- a/pkg/api/handlers/compat/containers_attach.go
+++ b/pkg/api/handlers/compat/containers_attach.go
@@ -89,7 +89,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 {
+ if err := ctr.Init(r.Context(), ctr.PodID() != ""); err != nil {
utils.Error(w, "Container in wrong state", http.StatusConflict, errors.Wrapf(err, "error preparing container %s for attach", ctr.ID()))
return
}
diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go
index 50f6b1a38..2556cdc2a 100644
--- a/pkg/api/handlers/libpod/containers.go
+++ b/pkg/api/handlers/libpod/containers.go
@@ -294,7 +294,7 @@ func InitContainer(w http.ResponseWriter, r *http.Request) {
utils.ContainerNotFound(w, name, err)
return
}
- err = ctr.Init(r.Context())
+ err = ctr.Init(r.Context(), ctr.PodID() != "")
if errors.Cause(err) == define.ErrCtrStateInvalid {
utils.Error(w, "container already initialized", http.StatusNotModified, err)
return