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

Parse the last partial line in CRI logs #55631

Merged
merged 1 commit into from
Nov 16, 2017

Conversation

mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Nov 13, 2017

@Random-Liu @yujuhong @runcom @feiskyer PTAL

Fixes part of #44976

This should work while we find a longer term format for CRI logs.

Signed-off-by: Mrunal Patel [email protected]

What this PR does / why we need it:
This PR attempts to parse the last line of log even if it doesn't have a newline. Today for CRI based log formats such lines are ignored and empty output is returned.

Which issue(s) this PR fixes
Fixes part of #44976

Special notes for your reviewer:
Use a CRI runtime like CRI-O and the output will be empty for these commands without this PR.

# kubectl create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/configmap/configmap.yaml
# kubectl create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/configmap/pod-configmap-volume1.yaml 
# kubectl logs dapi-test-pod-1 
very# 

Release Note:

NONE

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 13, 2017
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 13, 2017
@derekwaynecarr
Copy link
Member

@mrunalp - this implements what was proposed here in the absence of a better solution?

#44976 (comment)

what you have now is better than what we have previously, so this works for me for the moment.

@mrunalp
Copy link
Contributor Author

mrunalp commented Nov 15, 2017

@derekwaynecarr Yes, that's what this PR implements.
This can be improved later when we modify the log format but is the best we can do for now.

@derekwaynecarr
Copy link
Member

this is no worse than what we have before, and makes more content visible to users that were previously invisible. in that vein, this is good to me and doesn't preclude us doing more in future.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: derekwaynecarr, mrunalp

Associated issue: 44976

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2017
@Random-Liu
Copy link
Member

LGTM. I prefer adding a helper function instead of copying code, but I'm fine with doing that in another PR.

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We may also add a test for such case.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 55697, 55631, 51905, 55647, 55826). If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants