mirror of
https://github.com/containers/podman.git
synced 2025-09-26 00:06:04 +08:00
Add an API for Attach over HTTP API
The new APIv2 branch provides an HTTP-based remote API to Podman. The requirements of this are, unfortunately, incompatible with the existing Attach API. For non-terminal attach, we need append a header to what was copied from the container, to multiplex STDOUT and STDERR; to do this with the old API, we'd need to copy into an intermediate buffer first, to handle the headers. To avoid this, provide a new API to handle all aspects of terminal and non-terminal attach, including closing the hijacked HTTP connection. This might be a bit too specific, but for now, it seems to be the simplest approach. At the same time, add a Resize endpoint. This needs to be a separate endpoint, so our existing channel approach does not work here. I wanted to rework the rest of attach at the same time (some parts of it, particularly how we start the Attach session and how we do resizing, are (in my opinion) handled much better here. That may still be on the table, but I wanted to avoid breaking existing APIs in this already massive change. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
19
vendor/github.com/containers/conmon/runner/config/config.go
generated
vendored
Normal file
19
vendor/github.com/containers/conmon/runner/config/config.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
// BufSize is the size of buffers passed in to sockets
|
||||
BufSize = 8192
|
||||
// ConnSockBufSize is the size of the socket used for
|
||||
// to attach to the container
|
||||
ConnSockBufSize = 32768
|
||||
// WinResizeEvent is the event code the caller program will
|
||||
// send along the ctrl fd to signal conmon to resize
|
||||
// the pty window
|
||||
WinResizeEvent = 1
|
||||
// ReopenLogsEvent is the event code the caller program will
|
||||
// send along the ctrl fd to signal conmon to reopen the log files
|
||||
ReopenLogsEvent = 2
|
||||
// TimedOutMessage is the message sent back to the caller by conmon
|
||||
// when a container times out
|
||||
TimedOutMessage = "command timed out"
|
||||
)
|
7
vendor/github.com/containers/conmon/runner/config/config_unix.go
generated
vendored
Normal file
7
vendor/github.com/containers/conmon/runner/config/config_unix.go
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
// +build !windows
|
||||
|
||||
package config
|
||||
|
||||
const (
|
||||
ContainerAttachSocketDir = "/var/run/crio"
|
||||
)
|
7
vendor/github.com/containers/conmon/runner/config/config_windows.go
generated
vendored
Normal file
7
vendor/github.com/containers/conmon/runner/config/config_windows.go
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
// +build windows
|
||||
|
||||
package config
|
||||
|
||||
const (
|
||||
ContainerAttachSocketDir = "C:\\crio\\run\\"
|
||||
)
|
Reference in New Issue
Block a user