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 unmount errors when no directory #226

Merged
merged 3 commits into from
Oct 30, 2024
Merged

Conversation

beornf
Copy link
Contributor

@beornf beornf commented Jun 27, 2024

Description

This PR fixes unmount errors when there is no directory or the directory has already been unmounted. This makes the NodeUnstageVolume and NodeUnpublishVolume methods fully idempotent.

Copy link

Unit Tests and Coverage

Show Output
?   	github.com/vultr/vultr-csi/cmd/csi-vultr-driver	[no test files]%0A=== RUN   TestCreateVolume%0Atime="2024-06-27T08:16:31Z" level=info msg="Create Volume: called" capabilities="[mount:<> access_mode:<mode:SINGLE_NODE_WRITER > ]" test="create volume" volume-name=volume-test-name%0Atime="2024-06-27T08:16:32Z" level=info msg="Create Volume: created volume" size=10737418240 test="create volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec volume-name=test-bs volume-size=10%0A--- PASS: TestCreateVolume (1.00s)%0A=== RUN   TestDeleteVolume%0Atime="2024-06-27T08:16:32Z" level=info msg="Delete volume: called" test="delete volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec%0Atime="2024-06-27T08:16:32Z" level=info msg="Delete Volume: deleted" test="delete volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec%0A--- PASS: TestDeleteVolume (0.00s)%0A=== RUN   TestPublishVolume%0A--- PASS: TestPublishVolume (0.00s)%0A=== RUN   TestUnPublishVolume%0Atime="2024-06-27T08:16:32Z" level=info msg="Controller Publish Unpublish: called" node-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec test="delete volume" volume-id=245bb2fe-b55c-44a0-9a1e-ab80e4b5f088%0Atime="2024-06-27T08:16:32Z" level=info msg="Controller Unublish Volume: unpublished" node-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec test="delete volume" volume-id=245bb2fe-b55c-44a0-9a1e-ab80e4b5f088%0A--- PASS: TestUnPublishVolume (0.00s)%0A=== RUN   TestDriverSuite%0A--- PASS: TestDriverSuite (0.00s)%0APASS%0Atime="2024-06-27T08:16:32Z" level=info msg="Start listening with scheme unix, addr /tmp/csi.sock"%0Atime="2024-06-27T08:16:32Z" level=info msg="Listening for connections on address: &net.UnixAddr{Name:"/tmp/csi.sock", Net:"unix"}" address=/tmp/csi.sock proto=unix%0A	github.com/vultr/vultr-csi/driver	coverage: 29.0%25 of statements%0Aok  	github.com/vultr/vultr-csi/driver	1.007s	coverage: 29.0%25 of statements

Pusher: @beornf, Action: pull_request_target

@optik-aper optik-aper added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Oct 30, 2024
Copy link

Unit Tests and Coverage

Show Output
	github.com/vultr/vultr-csi/cmd/csi-vultr-driver		coverage: 0.0%25 of statements%0A=== RUN   TestCreateVolume%0Atime="2024-10-30T17:20:39Z" level=info msg="Create Volume: called" capabilities="[mount:{} access_mode:{mode:SINGLE_NODE_WRITER}]" test="create volume" volume-name=volume-test-name%0Atime="2024-10-30T17:20:40Z" level=info msg="Create Volume: created volume" size=10737418240 test="create volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec volume-name=test-bs volume-size=10%0A--- PASS: TestCreateVolume (1.00s)%0A=== RUN   TestDeleteVolume%0Atime="2024-10-30T17:20:40Z" level=info msg="Delete volume: called" test="delete volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec%0Atime="2024-10-30T17:20:40Z" level=info msg="Delete Volume: deleted" test="delete volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec%0A--- PASS: TestDeleteVolume (0.00s)%0A=== RUN   TestPublishVolume%0A--- PASS: TestPublishVolume (0.00s)%0A=== RUN   TestUnPublishVolume%0Atime="2024-10-30T17:20:40Z" level=info msg="Controller Publish Unpublish: called" node-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec test="delete volume" volume-id=245bb2fe-b55c-44a0-9a1e-ab80e4b5f088%0Atime="2024-10-30T17:20:40Z" level=info msg="Controller Unublish Volume: unpublished" node-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec test="delete volume" volume-id=245bb2fe-b55c-44a0-9a1e-ab80e4b5f088%0A--- PASS: TestUnPublishVolume (0.00s)%0A=== RUN   TestDriverSuite%0A--- PASS: TestDriverSuite (0.00s)%0APASS%0Atime="2024-10-30T17:20:40Z" level=info msg="Start listening with scheme unix, addr /tmp/csi.sock"%0Atime="2024-10-30T17:20:40Z" level=info msg="Listening for connections on address: &net.UnixAddr{Name:"/tmp/csi.sock", Net:"unix"}" address=/tmp/csi.sock proto=unix%0Acoverage: 29.2%25 of statements%0Aok  	github.com/vultr/vultr-csi/driver	1.006s	coverage: 29.2%25 of statements

Pusher: @optik-aper, Action: pull_request_target

@optik-aper optik-aper self-requested a review October 30, 2024 18:03
Copy link

Unit Tests and Coverage

Show Output
	github.com/vultr/vultr-csi/cmd/csi-vultr-driver		coverage: 0.0%25 of statements%0A=== RUN   TestCreateVolume%0Atime="2024-10-30T18:19:10Z" level=info msg="Create Volume: called" capabilities="[mount:{} access_mode:{mode:SINGLE_NODE_WRITER}]" test="create volume" volume-name=volume-test-name%0Atime="2024-10-30T18:19:11Z" level=info msg="Create Volume: created volume" size=10737418240 test="create volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec volume-name=test-bs volume-size=10%0A--- PASS: TestCreateVolume (1.00s)%0A=== RUN   TestDeleteVolume%0Atime="2024-10-30T18:19:11Z" level=info msg="Delete volume: called" test="delete volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec%0Atime="2024-10-30T18:19:11Z" level=info msg="Delete Volume: deleted" test="delete volume" volume-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec%0A--- PASS: TestDeleteVolume (0.00s)%0A=== RUN   TestPublishVolume%0A--- PASS: TestPublishVolume (0.00s)%0A=== RUN   TestUnPublishVolume%0Atime="2024-10-30T18:19:11Z" level=info msg="Controller Publish Unpublish: called" node-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec test="delete volume" volume-id=245bb2fe-b55c-44a0-9a1e-ab80e4b5f088%0Atime="2024-10-30T18:19:11Z" level=info msg="Controller Unublish Volume: unpublished" node-id=c56c7b6e-15c2-445e-9a5d-1063ab5828ec test="delete volume" volume-id=245bb2fe-b55c-44a0-9a1e-ab80e4b5f088%0A--- PASS: TestUnPublishVolume (0.00s)%0A=== RUN   TestDriverSuite%0A--- PASS: TestDriverSuite (0.00s)%0APASS%0Atime="2024-10-30T18:19:11Z" level=info msg="Start listening with scheme unix, addr /tmp/csi.sock"%0Atime="2024-10-30T18:19:11Z" level=info msg="Listening for connections on address: &net.UnixAddr{Name:"/tmp/csi.sock", Net:"unix"}" address=/tmp/csi.sock proto=unix%0Acoverage: 26.9%25 of statements%0Aok  	github.com/vultr/vultr-csi/driver	1.007s	coverage: 26.9%25 of statements

Pusher: @optik-aper, Action: pull_request_target

Copy link
Member

@optik-aper optik-aper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working. Thanks for the fix!

@optik-aper optik-aper merged commit ed96c33 into vultr:master Oct 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants