Skip to content

Commit e5020f3

Browse files
committed
docs: clarify requirements for deleting volumes
If you delete a CSI volume, the volume cannot be currently claimed by an allocation or in the process of being unpublished. This is documented in the CLI but not the API. Also, the documentation incorrectly says that the `volume delete` command silently returns without error if the volume doesn't exist, but that's incorrect. Fixes: #24756
1 parent b7a3940 commit e5020f3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

command/volume_delete.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Usage: nomad volume delete [options] <vol id>
2525
Delete a volume from an external storage provider. The volume must still be
2626
registered with Nomad in order to be deleted. Deleting will fail if the
2727
volume is still in use by an allocation or in the process of being
28-
unpublished. If the volume no longer exists, this command will silently
29-
return without an error.
28+
unpublished.
3029
3130
When ACLs are enabled, this command requires a token with the
3231
'csi-write-volume' and 'csi-read-volume' capabilities for the volume's

website/content/api-docs/volumes.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ for deleting the volume as comma-separated key-value pairs (see the
480480
example below). These secrets will be merged with any secrets already
481481
stored when the CSI volume was created.
482482

483+
The volume must still be registered with Nomad in order to be deleted. This API
484+
call fails if an allocation still claims the volume or if Nomad is unpublishing
485+
the volume.
486+
483487
### Parameters
484488

485489
- `:volume_id` `(string: <required>)` - Specifies the ID of the

website/content/commands/volume/delete.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ nomad volume delete [options] [volume]
2020
```
2121

2222
The `volume delete` command requires a single argument, specifying the ID of
23-
volume to be deleted. The volume must still be [registered] with Nomad in
24-
order to be deleted. Deleting will fail if the volume is still in use by an
25-
allocation or in the process of being unpublished. If the volume no longer
26-
exists, this command will silently return without an error.
23+
24+
volume to be deleted. The volume must still be [registered][] with Nomad in
25+
order to be deleted. Deleting fails if the volume is still in use by an
26+
allocation or in the process of being unpublished.
2727

2828
When ACLs are enabled, this command requires a token with the
2929
`csi-write-volume` capability for the volume's namespace.

0 commit comments

Comments
 (0)