-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add EOL to compat container logs #8083
Add EOL to compat container logs #8083
Conversation
/assign @mheon |
Thanks @crunchtime-ali LGTM |
@ashley-cui PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only do it for the compat layer:
if !utils.IsLibpodRequest(r) {
....
@ashley-cui WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me, since adding the \n using the remote client results in duplicate newlines, doing it only for the compat layer would make more sense and look cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vrothberg @ashley-cui do you rather want:
if utils.IsLibpodRequest(r) {
frame.WriteString(line.Msg)
} else {
frame.WriteString(line.Msg + "\n")
}
or
frame.WriteString(line.Msg)
if !utils.IsLibpodRequest(r) {
frame.WriteString("\n")
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter seems cleaner to me. Also please add a code comment (ideally with a link to the issue you're fixing) as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added and squashed @vrothberg
Signed-off-by: Alexander Zigelski <[email protected]>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: crunchtime-ali, rhatdan, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
looks like a timing issue is meeting up the works. @edsantiago is this one of your known "friends"?
|
LGTM |
restarted tests, agent stopped responding |
Cirrus-CI gives you one freebie restart if the agent konks out for some reason. Anything beyond that requires pressing the button 😞 |
/hold cancel |
Per request of @rhatdan I created the change mentioned by @psakar in #8058 as a pull request.
It fixes the problem that container logs provided by REST API do not contain an EOL (\n)