mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
WIP V2 attach bindings and test
* Add ErrLostSync to report lost of sync when de-mux'ing stream * Add logus.SetLevel(logrus.DebugLevel) when `go test -v` given * Add context to debugging messages Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
@ -285,6 +285,7 @@ func (c *Container) HTTPAttach(httpCon net.Conn, httpBuf *bufio.ReadWriter, stre
|
||||
|
||||
logrus.Infof("Performing HTTP Hijack attach to container %s", c.ID())
|
||||
|
||||
logSize := 0
|
||||
if streamLogs {
|
||||
// Get all logs for the container
|
||||
logChan := make(chan *logs.LogLine)
|
||||
@ -302,7 +303,7 @@ func (c *Container) HTTPAttach(httpCon net.Conn, httpBuf *bufio.ReadWriter, stre
|
||||
device := logLine.Device
|
||||
var header []byte
|
||||
headerLen := uint32(len(logLine.Msg))
|
||||
|
||||
logSize += len(logLine.Msg)
|
||||
switch strings.ToLower(device) {
|
||||
case "stdin":
|
||||
header = makeHTTPAttachHeader(0, headerLen)
|
||||
@ -341,7 +342,7 @@ func (c *Container) HTTPAttach(httpCon net.Conn, httpBuf *bufio.ReadWriter, stre
|
||||
if err := c.ReadLog(logOpts, logChan); err != nil {
|
||||
return err
|
||||
}
|
||||
logrus.Debugf("Done reading logs for container %s", c.ID())
|
||||
logrus.Debugf("Done reading logs for container %s, %d bytes", c.ID(), logSize)
|
||||
if err := <-errChan; err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user