From b23ab5ac157e65646b78e6236c8ce2536a7d7627 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Fri, 11 Jul 2025 15:01:06 -0400 Subject: [PATCH] docs: clarify requirements for deleting volumes (#26240) 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: https://github.com/hashicorp/nomad/issues/24756 --- command/volume_delete.go | 3 +-- website/content/api-docs/volumes.mdx | 4 ++++ website/content/commands/volume/delete.mdx | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/command/volume_delete.go b/command/volume_delete.go index 6718c8e9e..7e33706af 100644 --- a/command/volume_delete.go +++ b/command/volume_delete.go @@ -26,8 +26,7 @@ Usage: nomad volume delete [options] Delete a volume from an external storage provider. The volume must still be registered with Nomad in order to be deleted. Deleting will fail if the volume is still in use by an allocation or in the process of being - unpublished. If the volume no longer exists, this command will silently - return without an error. + unpublished. When ACLs are enabled, this command requires a token with the appropriate capability in the volume's namespace: the 'csi-write-volume' capability for diff --git a/website/content/api-docs/volumes.mdx b/website/content/api-docs/volumes.mdx index a9f32b596..afee25f47 100644 --- a/website/content/api-docs/volumes.mdx +++ b/website/content/api-docs/volumes.mdx @@ -497,6 +497,10 @@ for deleting the volume as comma-separated key-value pairs (see the example below). These secrets will be merged with any secrets already stored when the CSI volume was created. +The volume must still be registered with Nomad in order to be deleted. This API +call fails if an allocation still claims the volume or if Nomad is unpublishing +the volume. + ### Parameters - `:volume_id` `(string: )` - Specifies the ID of the diff --git a/website/content/commands/volume/delete.mdx b/website/content/commands/volume/delete.mdx index b4ce6cad0..c74ae3ee7 100644 --- a/website/content/commands/volume/delete.mdx +++ b/website/content/commands/volume/delete.mdx @@ -26,8 +26,7 @@ nomad volume delete [options] [volume] The `volume delete` command requires a single argument, specifying the ID of volume to be deleted. The volume must still be [registered][] with Nomad in order to be deleted. Deleting fails if the volume is still in use by an -allocation or in the process of being unpublished. If the volume no longer -exists, this command silently returns without an error. +allocation or in the process of being unpublished. When ACLs are enabled, this command requires a token with the appropriate capability in the volume's namespace: the `csi-write-volume` capability for CSI