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 <ypadia@redhat.com>
This commit is contained in:
yati1998 2025-01-14 18:39:27 +05:30 committed by mergify[bot]
parent 4b003156a4
commit 4101b63e02

View File

@ -876,6 +876,10 @@ func (rs *ReplicationServer) GetVolumeReplicationInfo(ctx context.Context,
if err != nil { if err != nil {
log.ErrorLog(ctx, err.Error()) 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) return nil, status.Errorf(codes.Internal, "failed to get remote status: %v", err)
} }