diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-15 13:19:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 13:19:43 -0700 |
commit | 343ab99b39771b5084a231a2db8d3dc969f395f9 (patch) | |
tree | 3ecfccf3343d3189bdbe93bbcaab64124edc3804 /libpod/oci.go | |
parent | c61a45caf8d7b4b049fa0124c1829eef138fef63 (diff) | |
parent | 6d1e5c713a3a62ba671c6966af23dc86ed2270dd (diff) | |
download | podman-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/oci.go')
-rw-r--r-- | libpod/oci.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libpod/oci.go b/libpod/oci.go index 9991c5625..6b1886f80 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -61,8 +61,7 @@ type OCIRuntime interface { // the attach session to be terminated if provided via the STDIN // channel. If they are not provided, the default detach keys will be // used instead. Detach keys of "" will disable detaching via keyboard. - // The streams parameter may be passed for containers that did not - // create a terminal and will determine which streams to forward to the + // The streams parameter will determine which streams to forward to the // client. HTTPAttach(ctr *Container, httpConn net.Conn, httpBuf *bufio.ReadWriter, streams *HTTPAttachStreams, detachKeys *string, cancel <-chan bool) error // AttachResize resizes the terminal in use by the given container. @@ -71,7 +70,17 @@ type OCIRuntime interface { // 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). - ExecContainer(ctr *Container, sessionID string, options *ExecOptions) (int, chan error, error) + // 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) + // ExecContainerHTTP executes a command in a running container and + // attaches its standard streams to a provided hijacked HTTP session. + // Maintains the same invariants as ExecContainer (returns on session + // 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) // 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 |