Skip to content
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: windows targetpath cleanup as part of node unpublish #545

Merged
merged 1 commit into from May 17, 2021

Conversation

aramase
Copy link
Member

@aramase aramase commented May 17, 2021

Signed-off-by: Anish Ramasekar anish.ramasekar@gmail.com

What this PR does / why we need it:

  • Fixes error when the file contents still exist
I0517 18:47:49.349641    3820 utils.go:76] GRPC request: {"target_path":"c:\\var\\lib\\kubelet\\pods\\5a9c8959-98de-4a7d-b3a9-36ee6b25c9cb\\volumes\\kubernetes.io~csi\\secrets-store-inline\\mount","volume_id":"csi-fd831ea73cd95fa276590bbccaece8e5c0c4f03dd768f6585cbb6ac80f30dd12"}
W0517 18:47:49.349698    3820 mount_helper_common.go:129] Warning: "c:\\var\\lib\\kubelet\\pods\\5a9c8959-98de-4a7d-b3a9-36ee6b25c9cb\\volumes\\kubernetes.io~csi\\secrets-store-inline\\mount" is not a mountpoint, deleting
E0517 18:47:49.353861    3820 nodeserver.go:230] "failed to clean and unmount target path" err="remove c:\\var\\lib\\kubelet\\pods\\5a9c8959-98de-4a7d-b3a9-36ee6b25c9cb\\volumes\\kubernetes.io~csi\\secrets-store-inline\\mount: The directory is not empty." targetPath="c:\\var\\lib\\kubelet\\pods\\5a9c8959-98de-4a7d-b3a9-36ee6b25c9cb\\volumes\\kubernetes.io~csi\\secrets-store-inline\\mount"

With this fix included:

I0517 19:52:36.860648    2564 utils.go:76] GRPC request: {"target_path":"c:\\var\\lib\\kubelet\\pods\\750b1102-bc4d-4f53-a140-42df8868d5f7\\volumes\\kubernetes.io~csi\\secrets-store-inline\\mount","volume_id":"csi-aab4dde902888c5f309a35080999aef99d92bb9171784ed2ce9e8e497db87b05"}
W0517 19:52:36.862649    2564 mount_helper_common.go:129] Warning: "c:\\var\\lib\\kubelet\\pods\\750b1102-bc4d-4f53-a140-42df8868d5f7\\volumes\\kubernetes.io~csi\\secrets-store-inline\\mount" is not a mountpoint, deleting
I0517 19:52:36.862649    2564 nodeserver.go:249] "node unpublish volume complete" targetPath="c:\\var\\lib\\kubelet\\pods\\750b1102-bc4d-4f53-a140-42df8868d5f7\\volumes\\kubernetes.io~csi\\secrets-store-inline\\mount"

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 17, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aramase

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from ritazh and tam7t May 17, 2021 19:49
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 17, 2021
@tam7t
Copy link
Contributor

tam7t commented May 17, 2021

Note: This reverts #526 but fileutil.GetMountedFiles does not include the scratch files (prefixed with ..)

The PR was also incorrect since the mounter.Unmount doesnt actually get executed by the helper, the error occurs: https://github.com/kubernetes/mount-utils/blob/19c6fae41ad49f3e4026f28b043f41343aa852fd/mount_helper_common.go#L90

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
@tam7t
Copy link
Contributor

tam7t commented May 17, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 17, 2021
@k8s-ci-robot k8s-ci-robot merged commit b864ecf into kubernetes-sigs:master May 17, 2021
@aramase aramase deleted the os-removeall branch May 17, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants