vultr / vultr-csi

Container Storage Interface (CSI) Driver for Vultr Block Storage
Apache License 2.0
40 stars 17 forks source link

Fix unmount errors when no directory #226

Closed beornf closed 1 week ago

beornf commented 4 months ago

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.

github-actions[bot] commented 4 months ago

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: ]" 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

github-actions[bot] commented 1 week ago

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

github-actions[bot] commented 1 week ago

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