swarmkit icon indicating copy to clipboard operation
swarmkit copied to clipboard

CSI node plugin fix for unstaging volumes

Open beornf opened this issue 1 year ago • 2 comments

- What I did While running a CSI volume plugin that supports staging, I created a new swarm service that initiated an attempt to unpublish a cluster volume. The node agent calls NodeUnpublishVolume which returns no errors then NodeUnstageVolume which also returns no errors. However, there was no call to the underlying plugin driver for NodeUnstageVolume.

- How I did it Fixed the unpublish check to only return in the failing condition that the volume was not unpublished.

- How to test it Create a cluster volume using CSI volume plugin then trigger a publish and unpublish by creating a swarm service and restarting the service.

- Description for the changelog

beornf avatar Jun 12 '24 18:06 beornf

Similarly, this early return in NodeUnpublishVolume skips the log which would be helpful in debugging: https://github.com/moby/swarmkit/blob/ea1a7cec35cb05dce3cff2de3f4ee28cbca6ca79/agent/csi/plugin/plugin.go#L366-L373

beornf avatar Jun 12 '24 19:06 beornf

@beornf New test case for this would nice as CSI logic is still quite new which bugs like this exist. You can find examples from my PRs #3116 and #3123

olljanat avatar Nov 23 '24 06:11 olljanat