Skip to content

Commit

Permalink
rbd: add check to getVolumeReplicationInfo
Browse files Browse the repository at this point in the history
this commit adds a check to getVolumeReplicationInfo
to include status not found error while getting the
remote status.
This helps the failover to be done even if remote site status
is not found

Signed-off-by: yati1998 <[email protected]>
(cherry picked from commit 4101b63)
  • Loading branch information
yati1998 authored and mergify[bot] committed Jan 14, 2025
1 parent b9d5632 commit 9e95ee1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/csi-addons/rbd/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,10 @@ func (rs *ReplicationServer) GetVolumeReplicationInfo(ctx context.Context,
if err != nil {
log.ErrorLog(ctx, err.Error())

if errors.Is(err, librbd.ErrNotExist) {
return nil, status.Errorf(codes.NotFound, "failed to get remote status: %v", err)
}

return nil, status.Errorf(codes.Internal, "failed to get remote status: %v", err)
}

Expand Down

0 comments on commit 9e95ee1

Please sign in to comment.