kubernetes-csi / csi-driver-smb

This driver allows Kubernetes to access SMB Server on both Linux and Windows nodes.
Apache License 2.0
485 stars 132 forks source link

fix: remove parent dir in DeleteVolume #850

Closed andyzhangx closed 2 weeks ago

andyzhangx commented 2 weeks ago

What type of PR is this? /kind bug

What this PR does / why we need it: fix: remove parent dir in DeleteVolume

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

``` [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.821458 1 utils.go:76] GRPC call: /csi.v1.Controller/DeleteVolume [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.821498 1 utils.go:77] GRPC request: {"secrets":"***stripped***","volume_id":"smb-server.default.svc.cluster.local/share#smb-6446/pvc-t8w7t#pvc-537d3618-595b-4796-81f6-794effd6d54e#"} [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.821684 1 controllerserver.go:169] DeleteVolume: found mountOptions(dir_mode=0777,file_mode=0777,uid=0,gid=0,mfsymlinks) for volume(smb-server.default.svc.cluster.local/share#smb-6446/pvc-t8w7t#pvc-537d3618-595b-4796-81f6-794effd6d54e#) [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.821757 1 controllerserver.go:189] begin to delete or archive subdirectory since secret is provided [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.821931 1 controllerserver.go:330] internally mounting //smb-server.default.svc.cluster.local/share at /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.822328 1 nodeserver.go:209] NodeStageVolume: targetPath(/tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e) volumeID(smb-server.default.svc.cluster.local/share#smb-6446/pvc-t8w7t#pvc-537d3618-595b-4796-81f6-794effd6d54e#) context(map[source://smb-server.default.svc.cluster.local/share]) mountflags([dir_mode=0777,file_mode=0777,uid=0,gid=0,mfsymlinks file_mode=0777]) mountOptions([dir_mode=0777,file_mode=0777,uid=0,gid=0,mfsymlinks file_mode=0777]) [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.822750 1 mount_linux.go:218] Mounting cmd (mount) with arguments (-t cifs -o dir_mode=0777,file_mode=0777,uid=0,gid=0,mfsymlinks,file_mode=0777, //smb-server.default.svc.cluster.local/share /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e) [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.867097 1 nodeserver.go:241] volume(smb-server.default.svc.cluster.local/share#smb-6446/pvc-t8w7t#pvc-537d3618-595b-4796-81f6-794effd6d54e#) mount "//smb-server.default.svc.cluster.local/share" on "/tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e" succeeded [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.867414 1 controllerserver.go:242] removing subdirectory at /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e/smb-6446 on internalVolumePath /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e/smb-6446/pvc-t8w7t [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.873482 1 controllerserver.go:348] internally unmounting /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.873510 1 nodeserver.go:264] NodeUnstageVolume: CleanupMountPoint on /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e with volume smb-server.default.svc.cluster.local/share#smb-6446/pvc-t8w7t#pvc-537d3618-595b-4796-81f6-794effd6d54e# [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.873578 1 mount_helper_common.go:93] unmounting "/tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e" (corruptedMount: false, mounterCanSkipMountPointChecks: true) [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.873597 1 mount_linux.go:360] Unmounting /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.879301 1 mount_helper_common.go:150] Deleting path "/tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e" [pod/csi-smb-controller-794dfcb554-sd6gc/smb] I0915 05:07:46.879522 1 nodeserver.go:273] NodeUnstageVolume: unmount volume smb-server.default.svc.cluster.local/share#smb-6446/pvc-t8w7t#pvc-537d3618-595b-4796-81f6-794effd6d54e# on /tmp/pvc-537d3618-595b-4796-81f6-794effd6d54e successfully ```

Does this PR introduce a user-facing change?:

fix: remove parent dir in DeleteVolume
k8s-ci-robot commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

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: - ~~[OWNERS](https://github.com/kubernetes-csi/csi-driver-smb/blob/master/OWNERS)~~ [andyzhangx] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
coveralls commented 2 weeks ago

Pull Request Test Coverage Report for Build 10868039423

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/smb/controllerserver.go 5 7 71.43%
<!-- Total: 9 11 81.82% -->
Totals Coverage Status
Change from base Build 10867357119: 0.009%
Covered Lines: 988
Relevant Lines: 1252

💛 - Coveralls
andyzhangx commented 2 weeks ago

/retest