Skip to content

Commit

Permalink
fix: throw error if volume is down state and with pending status, it …
Browse files Browse the repository at this point in the history
…might not recover

Signed-off-by: Shivanjan Chakravorty <[email protected]>
  • Loading branch information
Glitchfix committed Dec 13, 2023
1 parent 14c3328 commit c0358f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/server/sdk/volume_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func (s *VolumeServer) waitForVolumeReady(ctx context.Context, id string) (*api.
return false, nil
}

// The volume has entered a state of that might not recover from hence the status might be down and will be in pending state forever.
if v.GetStatus() == api.VolumeStatus_VOLUME_STATUS_DOWN && v.GetState() != api.VolumeState_VOLUME_STATE_PENDING {
return false, status.Errorf(codes.Internal, "Volume id %s got created but is in down state, please recreate the PVC", v.GetId())
}

// Continue waiting
return true, nil
})
Expand Down

0 comments on commit c0358f7

Please sign in to comment.