Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST APIv2 - log does not contain EOL #8058

Closed
psakar opened this issue Oct 19, 2020 · 4 comments
Closed

REST APIv2 - log does not contain EOL #8058

psakar opened this issue Oct 19, 2020 · 4 comments
Labels
HTTP API Bug is in RESTful API kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@psakar
Copy link
Contributor

psakar commented Oct 19, 2020

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Container logs provided by REST API does not contain EOL (\n)

Steps to reproduce the issue:

  1. To be determined (I've found out by debugging test containers Log output Wait Strategy

Describe the results you received:
Log lines are provided without EOL

Describe the results you expected:
Log lines are provided with EOL

Additional information you deem important (e.g. issue happens only occasionally):

diff --git a/pkg/api/handlers/compat/containers_logs.go b/pkg/api/handlers/compat/containers_logs.go
index d24b7d959..c01456454 100644
--- a/pkg/api/handlers/compat/containers_logs.go
+++ b/pkg/api/handlers/compat/containers_logs.go
@@ -148,7 +148,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
 			frame.WriteString(line.Time.Format(time.RFC3339))
 			frame.WriteString(" ")
 		}
-		frame.WriteString(line.Msg)
+		frame.WriteString(line.Msg + "\n")
 
 		if writeHeader {
 			binary.BigEndian.PutUint32(header[4:], uint32(frame.Len()))

Output of podman version:

Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.13.15
Built:        Wed Sep 30 21:51:15 2020
OS/Arch:      linux/amd64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 19, 2020
@psakar
Copy link
Contributor Author

psakar commented Oct 19, 2020

Related to #7927

@rhatdan
Copy link
Member

rhatdan commented Oct 20, 2020

Can you open this as a PR rather then an issue?

@jwhonce @baude PTAL

@mheon mheon added the HTTP API Bug is in RESTful API label Oct 20, 2020
@crunchtime-ali
Copy link
Contributor

@rhatdan @psakar I created the suggested change as a PR here #8083
If there is anything else I can help you with just tell me.

@rhatdan
Copy link
Member

rhatdan commented Oct 21, 2020

Awesome job @crunchtime-ali. Thanks.

@rhatdan rhatdan closed this as completed Oct 21, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
HTTP API Bug is in RESTful API kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants