Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DMajrekar committed May 30, 2024
1 parent a5309e9 commit 2a309e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/driver/controller_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.Control
log.Info().Str("volume_id", volume.ID).Msg("Volume sucessfully requested to be detached in Civo API")

// Fetch new state after 5 seconds
time.Sleep(5 * time.Second)
time.Sleep(10 * time.Second)
volume, err = d.CivoClient.GetVolume(req.VolumeId)
if err != nil {
log.Error().Err(err).Msg("Unable to find volume for unpublishing in Civo API")
Expand All @@ -351,7 +351,7 @@ func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.Control

// warn if the volume is not available
log.Error().Err(err).Msg("Civo Volume did not go back to 'available'")
return &csi.ControllerUnpublishVolumeResponse{}, nil
return nil, status.Errorf(codes.Unavailable, "Civo Volume did not go back to 'available'")
}

// ControllerExpandVolume allows for offline expansion of Volumes
Expand Down

0 comments on commit 2a309e5

Please sign in to comment.