-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Automated cherry pick of #117022: Fix directory mismatch for volume.SetVolumeOwnership()
#117574
Automated cherry pick of #117022: Fix directory mismatch for volume.SetVolumeOwnership()
#117574
Conversation
In most cases `dir` arg of `SetUpAt()` method of `volume.Mounter` interface is the same as `mounter.GetPath()` because we usually call `SetUpAt()` from `SetUp()` like this:" ``` func (ed *emptyDir) SetUp(mounterArgs volume.MounterArgs) error { return ed.SetUpAt(ed.GetPath(), mounterArgs) } ``` (this example is from `volume/emptydir/empty_dir.go`, but there are plenty other examples like that in `volume/*`) However, there is currently one exception. This is from `volume/projected/projected.go`: ``` if err := wrapped.SetUpAt(dir, mounterArgs); err != nil { return err } ``` (see https://github.com/kubernetes/kubernetes/blob/96306f144a3c917a97fe27c9ad5dd89e4213f741/pkg/volume/projected/projected.go#L203) In this case `dir` is not equal to `wrapped.GetPath()` and `volume.SetVolumeOwnership()` fails when called from `SetUpAt()` of wrapped volume: ``` lstat /var/lib/kubelet/pods/a2f6e58f-7edf-4c48-a97c-ef1b8fd3caf6/volumes/kubernetes.io~empty-dir/wrapped_kube-api-access-knvkv: no such file or directory ``` To fix the issue let's pass `dir` arg to `volume.SetVolumeOwnership()` explicitly, and use it instead of `mounter.GetPath()`.
Hi @mpatlasov. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @jsafrane |
/ok-to-test |
/triage accepted |
LGTM label has been added. Git tree hash: 3aa84537d93ffb9581f9710601b2e31499207cf5
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, mpatlasov 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 |
/hold |
/hold cancel |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
@jeremyrickard Hi Jeremy, I received email from you:
but I cannot see it as a comment here. I understand that now it's probably too late for this PR(s), but if I had to add "release note" words to PR description and missed it, it would be great for me to learn how we do it generally. Can you give me a link to a "proper" PR description with "release note" words (as example, any PR would fit). Thank you! |
Cherry pick of #117022 on release-1.27.
#117022: Fix directory mismatch for
volume.SetVolumeOwnership()
For details on the cherry pick process, see the cherry pick requests page.