Skip to content

Conversation

@andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Mar 13, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:

fix: only cleanup empty parent directories during DeleteVolume

[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.629160       1 utils.go:111] GRPC call: /csi.v1.Controller/DeleteVolume
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.629419       1 utils.go:112] GRPC request: {"secrets":"***stripped***","volume_id":"nfs-server.default.svc.cluster.local##nfs-270/pvc-dxb27#pvc-ce9651cb-815e-463c-bd67-a7215b97b85c#"}
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.630434       1 controllerserver.go:226] DeleteVolume: found mountOptions(nfsvers=4.1) for volume(nfs-server.default.svc.cluster.local##nfs-270/pvc-dxb27#pvc-ce9651cb-815e-463c-bd67-a7215b97b85c#)
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.630557       1 controllerserver.go:525] internally mounting nfs-server.default.svc.cluster.local:/ at /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.630729       1 nodeserver.go:133] NodePublishVolume: volumeID(nfs-server.default.svc.cluster.local##nfs-270/pvc-dxb27#pvc-ce9651cb-815e-463c-bd67-a7215b97b85c#) source(nfs-server.default.svc.cluster.local:/) targetPath(/tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c) mountflags([nfsvers=4.1])
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.630993       1 mount_linux.go:270] Mounting cmd (mount) with arguments (-t nfs -o nfsvers=4.1 nfs-server.default.svc.cluster.local:/ /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c)
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.675955       1 nodeserver.go:153] skip chmod on targetPath(/tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c) since mountPermissions is set as 0
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.676031       1 nodeserver.go:155] volume(nfs-server.default.svc.cluster.local##nfs-270/pvc-dxb27#pvc-ce9651cb-815e-463c-bd67-a7215b97b85c#) mount nfs-server.default.svc.cluster.local:/ on /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c succeeded
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.676084       1 controllerserver.go:295] removing subdirectory at /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c/nfs-270/pvc-dxb27
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.685621       1 controllerserver.go:302] DeleteVolume: removing empty directories in /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c/nfs-270
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.687404       1 utils.go:245] Removing empty directory /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c/nfs-270
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.688227       1 controllerserver.go:540] internally unmounting /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.688245       1 nodeserver.go:176] NodeUnpublishVolume: unmounting volume nfs-server.default.svc.cluster.local##nfs-270/pvc-dxb27#pvc-ce9651cb-815e-463c-bd67-a7215b97b85c# on /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.688254       1 nodeserver.go:181] force unmount nfs-server.default.svc.cluster.local##nfs-270/pvc-dxb27#pvc-ce9651cb-815e-463c-bd67-a7215b97b85c# on /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.689332       1 mount_helper_common.go:56] unmounting "/tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c" (corruptedMount: false, mounterCanSkipMountPointChecks: true)
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.689352       1 mount_linux.go:892] Unmounting /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.724365       1 mount_helper_common.go:150] Deleting path "/tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c"
[pod/csi-nfs-controller-6dcc8cc68c-mn26w/nfs] I0313 10:33:11.724912       1 nodeserver.go:189] NodeUnpublishVolume: unmount volume nfs-server.default.svc.cluster.local##nfs-270/pvc-dxb27#pvc-ce9651cb-815e-463c-bd67-a7215b97b85c# on /tmp/pvc-ce9651cb-815e-463c-bd67-a7215b97b85c successfully

Which issue(s) this PR fixes:

Fixes #855

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix: only cleanup empty parent directories during DeleteVolume

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 13, 2025
@k8s-ci-robot
Copy link
Contributor

[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:

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 added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 13, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 13, 2025
@coveralls
Copy link

coveralls commented Mar 13, 2025

Pull Request Test Coverage Report for Build 13851790872

Details

  • 26 of 41 (63.41%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 77.527%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/nfs/controllerserver.go 5 7 71.43%
pkg/nfs/utils.go 21 34 61.76%
Totals Coverage Status
Change from base Build 13825626462: -0.5%
Covered Lines: 1097
Relevant Lines: 1415

💛 - Coveralls

@andyzhangx andyzhangx force-pushed the fix-remove-root-dir-issue branch from 43c8438 to c834b8b Compare March 14, 2025 03:16
@andyzhangx andyzhangx force-pushed the fix-remove-root-dir-issue branch from c834b8b to 0d8402b Compare March 14, 2025 07:21
@andyzhangx
Copy link
Member Author

/retest

@andyzhangx andyzhangx merged commit e230b7f into kubernetes-csi:master Mar 15, 2025
16 of 18 checks passed
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. kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleaningup empty parents resulted in all data being deleted

3 participants