-
Notifications
You must be signed in to change notification settings - Fork 641
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
Empty LogPath will use journald's default path. #253
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
CLA signed. |
/assign @Random-Liu |
Is there some way I can make this simpler to review? Thanks |
Forgive my ignorance, but how long should I expect to wait before this PR is reviewed? Thanks |
Sorry for the delay. I will take a look today. Feel free to ping me on slack if you don't see any response after a day or two. |
// returning error. So check the path existence ourselves. | ||
if _, err := os.Stat(path); err != nil { | ||
return nil, fmt.Errorf("failed to stat the log path %q: %v", path, err) | ||
path := "" |
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 value of path
seems never updated?
return nil, fmt.Errorf("failed to stat the log path %q: %v", path, err) | ||
} | ||
// Get journal client from the log path. | ||
journal, err = sdjournal.NewJournalFromDir(cfg.LogPath) | ||
} |
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.
Now we fall back to system default path, can you print a message here on what path it is used?
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.
+1 for the comment above. @stribb Do you have time to update this?
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 agree it would be nice. But there's no API to find that out as far as I can tell.
https://www.freedesktop.org/software/systemd/man/sd_journal_open.html#
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.
ACK
/test all |
/retest |
@wangzhen127 Sorry, I'm new to GitHub PRs. Does my PR look reasonable or did I mess up? :) Thanks! |
/test all |
Not sure why the tests didn't run. Just triggered the tests manually. Do you mind squash all the 3 commits? The are not big and it is cleaner to just have one commit. |
By the way, k8s 1.6 code freeze is 8/29 this Thursday. I plan to cut NPD v0.7.1 and include it in k8s 1.16. This PR looks ok to me. Just need to squash the commits. If you plan to include it in v0.7.1, please do so by end of day today, so that we have enough time to release and test. Thanks! |
Thanks, I've squashed all the commits. Sorry for the delay: I was flying to Barcelona. |
/test all |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stribb, wangzhen127 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 |
At present, the empty LogPath will use the code's default journal path, without regard for the host's default journal path.
This code changes the default to use the host's path.