diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-21 16:02:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-21 16:02:52 +0200 |
commit | a852afab2f37026fa8a45d115c61cd77fb3e7ef1 (patch) | |
tree | f47d5211873d31dadb3b89b69d66397c744b2231 /libpod/oci.go | |
parent | 500ad31d1bd1aee1458b17f05c2dfb7937786e87 (diff) | |
parent | 24158d4a2eaa84088ca1ca1e85a0bcbb8399c2ac (diff) | |
download | podman-a852afab2f37026fa8a45d115c61cd77fb3e7ef1.tar.gz podman-a852afab2f37026fa8a45d115c61cd77fb3e7ef1.tar.bz2 podman-a852afab2f37026fa8a45d115c61cd77fb3e7ef1.zip |
Merge pull request #6270 from mheon/detached_exec
Implement detached exec
Diffstat (limited to 'libpod/oci.go')
-rw-r--r-- | libpod/oci.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libpod/oci.go b/libpod/oci.go index 6b1886f80..7c5218319 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -68,10 +68,10 @@ type OCIRuntime interface { AttachResize(ctr *Container, newSize remotecommand.TerminalSize) error // ExecContainer executes a command in a running container. - // Returns an int (exit code), error channel (errors from attach), and - // error (errors that occurred attempting to start the exec session). - // This returns once the exec session is running - not once it has - // completed, as one might expect. The attach session will remain + // Returns an int (PID of exec session), error channel (errors from + // attach), and error (errors that occurred attempting to start the exec + // session). This returns once the exec session is running - not once it + // has completed, as one might expect. The attach session will remain // running, in a goroutine that will return via the chan error in the // return signature. ExecContainer(ctr *Container, sessionID string, options *ExecOptions, streams *define.AttachStreams) (int, chan error, error) @@ -81,6 +81,10 @@ type OCIRuntime interface { // start, with a goroutine running in the background to handle attach). // The HTTP attach itself maintains the same invariants as HTTPAttach. ExecContainerHTTP(ctr *Container, sessionID string, options *ExecOptions, httpConn net.Conn, httpBuf *bufio.ReadWriter, streams *HTTPAttachStreams, cancel <-chan bool) (int, chan error, error) + // ExecContainerDetached executes a command in a running container, but + // does not attach to it. Returns the PID of the exec session and an + // error (if starting the exec session failed) + ExecContainerDetached(ctr *Container, sessionID string, options *ExecOptions, stdin bool) (int, error) // ExecAttachResize resizes the terminal of a running exec session. Only // allowed with sessions that were created with a TTY. ExecAttachResize(ctr *Container, sessionID string, newSize remotecommand.TerminalSize) error @@ -165,6 +169,9 @@ type ExecOptions struct { // If provided but set to "", detaching from the container will be // disabled. DetachKeys *string + // ExitCommand is a command that will be run after the exec session + // exits. + ExitCommand []string } // HTTPAttachStreams informs the HTTPAttach endpoint which of the container's |