CSI: `volume.name` uniqueness is not enforced per-plugin
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
@ron-savoia wrote in https://github.com/hashicorp/nomad/issues/18741#issuecomment-1772988090
> I also noticed another oddity when creating volumes in separate namespaces where the volume name is the same. When the name is the same for two volumes in separate nomad namespaces only one volume was created on the storage side, which was accessable by both jobs in different namespaces.
In the CSI spec, the `CreateVolumeRequest.name` field is intended as both an idempotency token and a suggested name for the storage provider. Nomad compounds this arguably unfortunate-but-unavoidable design decision by overloading it further to be the display name for the volume. If you send `CreateVolumeRequest` with the same name, that's supposed to tell the storage provider that the volume is the same one.
We should validate that the same name isn't being reused for different volumes for the same plugin, in the RPC handler.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the volume RPC handler and trace how CreateVolumeRequest.name is validated and persisted for each plugin. Confirm the behavior for equal names in separate namespaces, then add validation so different volumes cannot reuse a name for the same plugin and verify that separate plugins remain unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100