hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.87k stars 1.95k forks source link

Prefix matched multiple volumes #17132

Closed SunSparc closed 3 months ago

SunSparc commented 1 year ago

Nomad version

client v1.5.5 server v1.5.3

Operating system and Environment details

macOS Ventura 13.3.1 (a)

Issue

$ nomad volume status
Container Storage Interface
ID                       Name                     Plugin ID       Schedulable  Access Mode
test-volume              test-volume              cloud-provider  true         <none>
test-volume-development  test-volume-development  cloud-provider  true         single-node-writer
test-volume-production   test-volume-production   cloud-provider  true         single-node-writer

$ nomad volume deregister test-volume
Prefix matched multiple volumes

$ nomad volume detach test-volume fa7d1a0d-9e03-a85b-fd55-a9071c79632f
Prefix matched multiple volumes

Reproduction steps

Create multiple volume, one of which is identified solely by characters which are identical to the "prefix" used on the others.

Expected Result

An ID should not be treated as a prefix. I expect to provide an ID and have Nomad recognize it as such.

Actual Result

Cannot deregister/detach/delete a volume that has an identifier that matches initial characters of another volume identifier.

Related Issues

schmichael commented 1 year ago

Thanks for the report @SunSparc. Until we ship a fix for the CLI you can use curl or nomad operator api to work around this:

nomad operator api -X DELETE /v1/volume/csi/fa7d1a0d-9e03-a85b-fd55-a9071c79632f

https://developer.hashicorp.com/nomad/api-docs/volumes#deregister-volume

tgross commented 3 months ago

PR in progress here: https://github.com/hashicorp/nomad/pull/23502