From 21f396de6f5024abbf6edd2ca63edcb1525eefcc Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 19 Aug 2021 18:24:47 -0400 Subject: logs: adjust handling around partial log messages In libpod/logs.LogLine.Write(), don't write a newline to stdout/stderr when the log message is only part of a line. In libpod.ConmonOCIRuntime.HTTPAttach(), don't send a newline over the HTTP connection when the log message is only part of a line. In pkg/api/handlers/compat.LogsFromContainer(), don't send a newline over the HTTP connection when the log message is only part of a line, and don't make doing so conditional on whether or not the client used the docker or podman endpoint. In pkg/domain/infra/tunnel.ContainerEngine.ContainerLogs(), don't add our own newline to log messages, since they already come through from the server when they need to. Signed-off-by: Nalin Dahyabhai --- pkg/api/handlers/compat/containers_logs.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pkg/api/handlers/compat/containers_logs.go') diff --git a/pkg/api/handlers/compat/containers_logs.go b/pkg/api/handlers/compat/containers_logs.go index 656e2c627..0c10ce75e 100644 --- a/pkg/api/handlers/compat/containers_logs.go +++ b/pkg/api/handlers/compat/containers_logs.go @@ -152,9 +152,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) { } frame.WriteString(line.Msg) - // Log lines in the compat layer require adding EOL - // https://github.com/containers/podman/issues/8058 - if !utils.IsLibpodRequest(r) { + if !line.Partial() { frame.WriteString("\n") } -- cgit v1.2.3-54-g00ecf