summaryrefslogtreecommitdiff
path: root/libpod/oci_conmon_linux.go
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2021-08-19 18:24:47 -0400
committerNalin Dahyabhai <nalin@redhat.com>2021-08-23 18:00:18 -0400
commit21f396de6f5024abbf6edd2ca63edcb1525eefcc (patch)
treef1f030aeedb7af3a83f0d328485f76835b3a4217 /libpod/oci_conmon_linux.go
parentb20a5470597897931699b976a9ed9ad1b2651c42 (diff)
downloadpodman-21f396de6f5024abbf6edd2ca63edcb1525eefcc.tar.gz
podman-21f396de6f5024abbf6edd2ca63edcb1525eefcc.tar.bz2
podman-21f396de6f5024abbf6edd2ca63edcb1525eefcc.zip
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 <nalin@redhat.com>
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r--libpod/oci_conmon_linux.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index ff25be234..c14911980 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -625,9 +625,11 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http.
if err != nil {
break
}
- _, err = httpBuf.Write([]byte("\n"))
- if err != nil {
- break
+ if !logLine.Partial() {
+ _, err = httpBuf.Write([]byte("\n"))
+ if err != nil {
+ break
+ }
}
err = httpBuf.Flush()
if err != nil {