Skip to content

Commit

Permalink
fix(instance): wait for volumes to be available before deletion (#4388)
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Dec 27, 2024
1 parent 5affb66 commit 3cf1e63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/namespaces/instance/v1/custom_server_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,11 @@ func serverDeleteVolume(volume *instance.VolumeServer, instanceAPI *instance.API
var err error

if volume.VolumeType == instance.VolumeServerVolumeTypeSbsVolume {
volumeAvailable := block.VolumeStatusAvailable
_, err = blockAPI.WaitForVolumeAndReferences(&block.WaitForVolumeAndReferencesRequest{
Zone: volume.Zone,
VolumeID: volume.ID,
Zone: volume.Zone,
VolumeID: volume.ID,
VolumeTerminalStatus: &volumeAvailable,
})
if err != nil {
return errorDeletingResource(err)
Expand Down

0 comments on commit 3cf1e63

Please sign in to comment.