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

Add EOL to compat container logs #8083

Merged
merged 1 commit into from
Oct 21, 2020
Merged

Add EOL to compat container logs #8083

merged 1 commit into from
Oct 21, 2020

Conversation

crunchtime-ali
Copy link
Contributor

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)

@crunchtime-ali
Copy link
Contributor Author

/assign @mheon

@rhatdan
Copy link
Member

rhatdan commented Oct 20, 2020

Thanks @crunchtime-ali
Could you sign your commits.
git commit -a -s --amend
git push --force

LGTM
Should we have similar in the libpod interface?

@jwhonce @baude @containers/podman-maintainers PTAL

@mheon
Copy link
Member

mheon commented Oct 20, 2020

@ashley-cui PTAL

Copy link
Member

@saschagrunert saschagrunert left a 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")
Copy link
Member

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?

Copy link
Member

@ashley-cui ashley-cui Oct 21, 2020

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

Copy link
Contributor Author

@crunchtime-ali crunchtime-ali Oct 21, 2020

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")
}

Copy link
Member

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.

Copy link
Contributor Author

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]>
@rhatdan
Copy link
Member

rhatdan commented Oct 21, 2020

/lgtm
/approve
/hold
@crunchtime-ali Thanks.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2020
@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2020
@TomSweeneyRedHat
Copy link
Member

looks like a timing issue is meeting up the works. @edsantiago is this one of your known "friends"?

[+0008s] ok 52 [01-basic] GET info : status=200
[+0008s] not ok 53 [01-basic] Time for ten /info requests
[+0008s] #  expected: <= 7 seconds
[+0008s] #    actual: 8 seconds

@TomSweeneyRedHat
Copy link
Member

LGTM
once test gremlins are chased away

@edsantiago
Copy link
Member

[+0008s] not ok 53 [01-basic] Time for ten /info requests - addressed in current master.

Two other failures are #8068 which @cevich claims "should retry automatically" so I'm not going to press Re-run

@jwhonce
Copy link
Member

jwhonce commented Oct 21, 2020

restarted tests, agent stopped responding

@cevich
Copy link
Member

cevich commented Oct 21, 2020

should retry automatically

Cirrus-CI gives you one freebie restart if the agent konks out for some reason. Anything beyond that requires pressing the button 😞

@rhatdan
Copy link
Member

rhatdan commented Oct 21, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2020
@openshift-merge-robot openshift-merge-robot merged commit 61b276a into containers:master 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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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 this pull request may close these issues.