Skip to content

Commit 4101b63

Browse files
yati1998mergify[bot]
authored andcommitted
rbd: add check to getVolumeReplicationInfo
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]>
1 parent 4b00315 commit 4101b63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/csi-addons/rbd/replication.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,10 @@ func (rs *ReplicationServer) GetVolumeReplicationInfo(ctx context.Context,
876876
if err != nil {
877877
log.ErrorLog(ctx, err.Error())
878878

879+
if errors.Is(err, librbd.ErrNotExist) {
880+
return nil, status.Errorf(codes.NotFound, "failed to get remote status: %v", err)
881+
}
882+
879883
return nil, status.Errorf(codes.Internal, "failed to get remote status: %v", err)
880884
}
881885

0 commit comments

Comments
 (0)