-
Notifications
You must be signed in to change notification settings - Fork 42.1k
Fixed subpath cleanup when /var/lib/kubelet is a symlink. #68741
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
Conversation
pkg/util/mount/mount.go
Outdated
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.
err - tests may be?
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's the problematic part. e2e test would require changing /var/lib/kubelet into a symlink somehow.
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.
Can we not write/update unit test for IsNotMountPoint, so as it considers symbolic links properly?
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.
Proper IsNotMountPoint unit test would require mounting / bind-mounting stuff, which is impossible in an unit test. I could fake all this, but then it would just test very little piece of code and I don't think it's worth all the effort.
|
I can see bunch of subpath tests failing, will investigate tomorrow. |
pkg/util/mount/mount.go
Outdated
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.
Should return true (not mounted) here. I think e2e tests failed because of this. In first volume setup, pod volume mount point does not exist.
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.
You're right, fixed.
I wonder why some code checks the returned bool without checking err...
5e5578b to
9e24ccb
Compare
|
/retest |
|
/kind bug |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cofyc, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@saad-ali, this is a bugfix, can we get it into 1.12? |
|
Is this a 1.12 regression? |
|
/retest Review the full test history for this PR. Silence the bot with an |
|
It's not 1.12 regression, it was broken by our security subpath patches in all branches. |
|
/retest |
What this PR does / why we need it:
kubelet should resolve symlinks before checking /proc/mounts or /proc/1/mountinfo, just in case /var/lib/kubelet itself is a symlink,
Fixes #68740
Release note:
/sig storage
@cofyc @msau42 @gnufied PTAL