-
Notifications
You must be signed in to change notification settings - Fork 40.6k
kubelet: set terminationMessagePath perms to 0660 #108076
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
Open
skrobul
wants to merge
5
commits into
kubernetes:master
Choose a base branch
from
skrobul:kubelet-no-world-writable-termpath
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e6619c9
kubelet: set terminationMessagePath perms to 0660
skrobul b6beb97
node runtime test: use non-root group
skrobul fd5a394
kuberuntime: change ownership of the termination-log file
skrobul 9cbab5b
kuberuntime: add nil check for SecurityContext
skrobul c4a75ea
kuberuntime: linter updates
skrobul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 PR mentions the terminationMessagePath that is defined a few lines below: https://github.com/kubernetes/kubernetes/pull/108076/files#diff-d86ffc24d8e4c9deafd3e39e8f4ee3546ee46a31dcea8ea6526443b3f4bffa28R420
How is it that changing the
containerLogPath
affects theterminationMessagePath
?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.
ok, so my goal is to get rid of the world writeable file regardless of how is it called. The error message on line 406 suggests that
termination-log file
is the same ascontainerLogPath
- is it not?The
terminationMessagePath
as I understand it is an absolute path that is used when mounting the volume andit has not much to do with what is known as the concept of termination message despite the name. In fact, even the error message on 415 refers to
containerLogPath
rather thanterminationMessagePath
.At this point I am bit confused about this code - if that's not the line responsible for creating the empty world writable files like this:
then what is?
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.
It might very well be the same, I'm unsure. But some explanation on the commit msg would be helpful so it is easier to review, you probably figured that out when writing the PR :)
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.
Ohh, I see it now. It seems a bind mount is created a few lines below where the source is the host path (containerLogPath) and the destination is the terminationMessagePath.
See here: https://github.com/kubernetes/kubernetes/pull/108076/files#diff-d86ffc24d8e4c9deafd3e39e8f4ee3546ee46a31dcea8ea6526443b3f4bffa28L422-L426
So this is solved :)
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.
Yeah, I didn't want to make any statements I was not sure about - initially I also had thought that
containerLogPath
referred to a log with whatever is printed out to container's standard output, but that doesn't seem to be the case.Either way, big thank you for the review and looking into this. Apologies it took me so long to respond, I have missed the notification email.