-
Notifications
You must be signed in to change notification settings - Fork 288
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
Fix cluster directory being created with root ownership #8120
Conversation
When hostpaths used for bind mounting in Docker don't exist at the time the container is created, dockerd creates the directory. dockerd runs as root on most systems hence the directory is created with root ownership. This ensures the directory exists before we attempt to launch the tools container that bind mounts the cluster directory.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8120 +/- ##
=======================================
Coverage 73.40% 73.40%
=======================================
Files 577 577
Lines 35899 35900 +1
=======================================
+ Hits 26351 26352 +1
Misses 7882 7882
Partials 1666 1666 ☔ View full report in Codecov by Sentry. |
/cherry-pick release-0.19 |
@chrisdoherty4: once the present PR merges, I will cherry-pick it on top of release-0.19 in a new PR and assign it to you. In response to this:
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. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrisdoherty4 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 |
@chrisdoherty4: new pull request created: #8121 In response to this:
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. |
On occasion we find the cluster directory created by EKS-A is created with root ownership.
When hostpaths used for bind mounting in Docker don't exist at the time the container is created, dockerd creates the directory. dockerd runs as root on most systems hence the directory is created with root ownership.
This ensures the directory exists before we attempt to launch the tools container that bind mounts the cluster directory.
The docker command was demonstrated to be executing before the directory is created through an strace.
An analysis of stracing the docker daemon with timestamps suggested on successful runs that the timing was extremely close and on failed runs the container launched first, hence dockerd created the host path with root ownership.
The fix inverts the syscalls removing any race.