Skip to content

API docs don't include invariants for CSI volume delete #24756

Open
@Vickysomtee

Description

@Vickysomtee

Nomad version

Nomad v1.6.0
BuildDate 2023-07-18T18:51:11Z
Revision 87d411f

Operating system and Environment details

Ubuntu

Issue

I am using the go sdk to successfully create Hetzner volumes for Postgres Databases on Nomad but I am unable to delete the volume from the external storage provider (Hetzner) after deregistering it from nomad.

I use the info func to get the volume

	res, _, err := client.CSIVolumes().Info(id, &nomad.QueryOptions{
		Namespace: "default",
		AuthToken: "xxxxxxxxxxxxxxxxxxxxx",
	})

Then pass the externalID gotten from the above res to the DeleteOpts func to delete the volume from the external storage provider (Hetzner)

	errr := client.CSIVolumes().DeleteOpts(&nomad.CSIVolumeDeleteRequest{
		ExternalVolumeID: res.ExternalID,
	}, &nomad.WriteOptions{
		Namespace: "default",
		AuthToken: "xxxxxxxxxxxxxxxxxxxxxxxxx",
	})

But I get this error

Unexpected response code: 500 (rpc error: volume not found: xxxxxxxxx)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Needs Roadmapping

Relationships

None yet

Development

No branches or pull requests

Issue actions