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 a5f6d89)
  • Loading branch information
yati1998 committed Jan 15, 2025
1 parent 52a4d3e commit 99a5c00
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 99a5c00

Please sign in to comment.