summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-15 13:19:43 -0700
committerGitHub <noreply@github.com>2020-05-15 13:19:43 -0700
commit343ab99b39771b5084a231a2db8d3dc969f395f9 (patch)
tree3ecfccf3343d3189bdbe93bbcaab64124edc3804 /libpod/container_internal.go
parentc61a45caf8d7b4b049fa0124c1829eef138fef63 (diff)
parent6d1e5c713a3a62ba671c6966af23dc86ed2270dd (diff)
downloadpodman-343ab99b39771b5084a231a2db8d3dc969f395f9.tar.gz
podman-343ab99b39771b5084a231a2db8d3dc969f395f9.tar.bz2
podman-343ab99b39771b5084a231a2db8d3dc969f395f9.zip
Merge pull request #5831 from mheon/exec_http_attach
APIv2 ExecStart (Attached Only)
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 5baa5fc1c..909ad9851 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1011,6 +1011,14 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
logrus.Debugf("Created container %s in OCI runtime", c.ID())
+ // Remove any exec sessions leftover from a potential prior run.
+ if len(c.state.ExecSessions) > 0 {
+ if err := c.runtime.state.RemoveContainerExecSessions(c); err != nil {
+ logrus.Errorf("Error removing container %s exec sessions from DB: %v", c.ID(), err)
+ }
+ c.state.ExecSessions = make(map[string]*ExecSession)
+ }
+
c.state.ExitCode = 0
c.state.Exited = false
c.state.State = define.ContainerStateCreated